');
$that.addClass('finished-loading');
fullWidthContentColumns();
$(window).trigger('resize');
});
});
}
if($('.products-carousel').length > 0) productCarouselInit();
function fwCarouselLinkFix(){
var $mousePosStart=0;
var $mousePosEnd=0;
$('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').mousedown(function(e){
$mousePosStart=e.clientX;
});
$('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').mouseup(function(e){
$mousePosEnd=e.clientX;
});
$('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').click(function(e){
if(Math.abs($mousePosStart - $mousePosEnd) > 10) return false;
});
}
fwCarouselLinkFix();
function carouselHeightCalcs(){
$('.carousel.portfolio-items.finished-loading').each(function(){
var bottomSpace=($(this).parents('.carousel-wrap').attr('data-full-width')=='true'&&$(this).find('.style-2, .style-3, .style-4').length > 0) ? 0:28 ;
var tallestMeta=0;
$(this).find('> li').each(function(){
($(this).find('.work-meta').height() > tallestMeta) ? tallestMeta=$(this).find('.work-meta').height():tallestMeta=tallestMeta;
});
$(this).parents('.caroufredsel_wrapper').css({
'height':($(this).find('.work-item').outerHeight() + tallestMeta + bottomSpace -2) + 'px'
});
if($('body.ascend').length > 0&&$(this).parents('.carousel-wrap').attr('data-full-width')!='true'){
$(this).parents('.carousel-wrap').find('.item-count .current').html(Math.ceil(($(this).triggerHandler("currentPosition")+1)/$(this).triggerHandler("currentVisible").length));
$(this).parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($(this).find('> li').length / $(this).triggerHandler("currentVisible").length));
}});
$('.carousel.finished-loading:not(".portfolio-items, .clients"), .caroufredsel_wrapper .products.finished-loading').each(function(){
var tallestColumn=0;
$(this).find('> li').each(function(){
($(this).height() > tallestColumn) ? tallestColumn=$(this).height():tallestColumn=tallestColumn;
});
$(this).css('height',tallestColumn + 5);
$(this).parents('.caroufredsel_wrapper').css('height',tallestColumn + 5);
if($('body.ascend').length > 0&&$(this).parents('.carousel-wrap').attr('data-full-width')!='true'){
$(this).parents('.carousel-wrap').find('.item-count .current').html(Math.ceil(($(this).triggerHandler("currentPosition")+1)/$(this).triggerHandler("currentVisible").length));
$(this).parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($(this).find('> li').length / $(this).triggerHandler("currentVisible").length));
}});
}
function clientsCarouselInit(){
$('.carousel.clients').each(function(){
var $that=$(this);
var columns;
var $autoRotate=(!$(this).hasClass('disable-autorotate')) ? true:false;
(parseInt($(this).attr('data-max'))) ? columns=parseInt($(this).attr('data-max')):columns=5;
if($(window).width() < 690&&$('body').attr('data-responsive')=='1'){ columns=2; $(this).addClass('phone') }
var $element=$that;
if($that.find('img').length==0) $element=$('body');
imagesLoaded($element,function(instance){
$that.carouFredSel({
circular: true,
responsive: true,
items:{
height:$that.find('> div:first').height(),
width:$that.find('> div:first').width(),
visible:{
min:1,
max:columns
}},
swipe:{
onTouch:true,
onMouse:true
},
scroll: {
items:1,
easing:'easeInOutCubic',
duration:'800',
pauseOnHover:true
},
auto:{
play:$autoRotate,
timeoutDuration:2700
}}).animate({'opacity': 1},1300);
$that.addClass('finished-loading');
$that.parents('.carousel-wrap').wrap('
');
$(window).trigger('resize');
});
});
}
if($('.carousel').length > 0) clientsCarouselInit();
function clientsCarouselHeightRecalc(){
var tallestImage=0;
$('.carousel.clients.finished-loading').each(function(){
$(this).find('> div').each(function(){
($(this).height() > tallestImage) ? tallestImage=$(this).height():tallestImage=tallestImage;
});
$(this).css('height',tallestImage);
$(this).parent().css('height',tallestImage);
});
}
function carouselfGrabbingClass(){
$('body').on('mousedown','.caroufredsel_wrapper, .carousel-wrap[data-full-width="true"] .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a',function(){
$(this).addClass('active');
});
$('body').on('mouseup','.caroufredsel_wrapper, .carousel-wrap[data-full-width="true"] .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a',function(){
$(this).removeClass('active');
});
}
carouselfGrabbingClass();
$('body.ascend').on('mouseover','.carousel-next',function(){
$(this).parent().find('.carousel-prev, .item-count').addClass('next-hovered');
});
$('body.ascend').on('mouseleave','.carousel-next',function(){
$(this).parent().find('.carousel-prev, .item-count').removeClass('next-hovered');
});
function clientsFadeIn(){
$clientsOffsetPos=($('#nectar_fullscreen_rows').length > 0) ? 100: 'bottom-in-view';
$($fullscreenSelector+'.clients.fade-in-animation').each(function(){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
$that.find('> div').each(function(i){
$(this).delay(i*80).transition({'opacity':"1"},450);
});
setTimeout(function(){ $that.addClass('completed'); },($that.find('> div').length*80) + 450);
$that.addClass('animated-in');
waypoint.destroy();
},
offset: $clientsOffsetPos
});
});
}
jQuery.fn.setCursorPosition=function(position){
if(this.lengh==0) return this;
return $(this).setSelection(position, position);
}
jQuery.fn.setSelection=function(selectionStart, selectionEnd){
if(this.lengh==0) return this;
input=this[0];
if(input.createTextRange){
var range=input.createTextRange();
range.collapse(true);
range.moveEnd('character', selectionEnd);
range.moveStart('character', selectionStart);
range.select();
}else if(input.setSelectionRange){
input.focus();
input.setSelectionRange(selectionStart, selectionEnd);
}
return this;
}
$.extend($.expr[':'], {
transparent: function(elem, i, attr){
return($(elem).css("opacity")==="0");
}});
function getQueryParams(qs){
qs=qs.split("+").join(" ");
var params={},
tokens,
re=/[?&]?([^=]+)=([^&]*)/g;
while (tokens=re.exec(qs)){
params[decodeURIComponent(tokens[1])]
= decodeURIComponent(tokens[2]);
}
return params;
}
var $_GET=getQueryParams(document.location.search);
$.fn.countTo=function (options){
options=options||{};
return $(this).each(function (){
var settings=$.extend({}, $.fn.countTo.defaults, {
from: $(this).data('from'),
to: $(this).data('to'),
speed: $(this).data('speed'),
refreshInterval: $(this).data('refresh-interval'),
decimals: $(this).data('decimals')
}, options);
var loops=Math.ceil(settings.speed / settings.refreshInterval),
increment=(settings.to - settings.from) / loops;
var self=this,
$self=$(this),
loopCount=0,
value=settings.from,
data=$self.data('countTo')||{};
$self.data('countTo', data);
if(data.interval){
clearInterval(data.interval);
}
data.interval=setInterval(updateTimer, settings.refreshInterval);
render(value);
function updateTimer(){
value +=increment;
loopCount++;
render(value);
if(typeof(settings.onUpdate)=='function'){
settings.onUpdate.call(self, value);
}
if(loopCount >=loops){
$self.removeData('countTo');
clearInterval(data.interval);
value=settings.to;
if(typeof(settings.onComplete)=='function'){
settings.onComplete.call(self, value);
}}
}
function render(value){
var formattedValue=settings.formatter.call(self, value, settings);
$self.html(formattedValue);
}});
};
$.fn.countTo.defaults={
from: 0,
to: 0,
speed: 1000,
refreshInterval: 100,
decimals: 0,
formatter: formatter,
onUpdate: null,
onComplete: null
};
function formatter(value, settings){
return value.toFixed(settings.decimals);
}
function milestoneInit(){
$('.nectar-milestone').each(function(){
if($(this).is('[data-symbol]')){
if($(this).find('.symbol-wrap').length==0){
if($(this).attr('data-symbol-pos')=='before'){
$(this).find('.number').prepend('
' + $(this).attr('data-symbol') + '
');
}else{
$(this).find('.number').append('
' + $(this).attr('data-symbol') + '
');
}}
$symbol_size=($(this).attr('data-symbol-size')==$(this).find('.number').attr('data-number-size')&&$(this).attr('data-symbol-alignment')=='superscript') ? 32:parseInt($(this).attr('data-symbol-size'));
$(this).find('.symbol-wrap').css({'font-size': $symbol_size + 'px', 'line-height': $symbol_size + 'px'});
}
$(this).find('.number').css({'font-size': $(this).find('.number').attr('data-number-size') +'px', 'line-height': $(this).find('.number').attr('data-number-size') + 'px'});
});
if(!$('body').hasClass('mobile')&&$('.nectar-milestone').length > 0){
var $blurCssString='';
$($fullscreenSelector+'.nectar-milestone.motion_blur').each(function(i){
$(this).addClass('instance-'+i);
var $currentColor=$(this).find('.number').css('color');
var colorInt=parseInt($currentColor.substring(1),16);
var R=(colorInt & 0xFF0000) >> 16;
var G=(colorInt & 0x00FF00) >> 8;
var B=(colorInt & 0x0000FF) >> 0;
var $rgbaColorStart='rgba('+R+','+G+','+B+',0.2)';
var $rgbaColorEnd='rgba('+R+','+G+','+B+',1)';
var $numberSize=parseInt($(this).find('.number').attr('data-number-size'));
$blurCssString +='@keyframes motion-blur-number-'+i+' { ' +
' 0% { '+
'opacity: 0;'+
'color: '+$rgbaColorStart+'; '+
'text-shadow: 0 '+$numberSize/20+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/10+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/6+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/5+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/4+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/20+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/10+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/6+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/5+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/4+'px 0 '+$rgbaColorStart+'; '+
'transform: translateZ(0px) translateY(-100%); '+
'-webkit-transform: translateZ(0px) translateY(-100%); '+
'} '+
'33% { opacity: 1 }' +
'100% { '+
'color: '+$rgbaColorEnd+'; '+
'text-shadow: none; '+
'transform: translateZ(0px) translateY(0px); '+
'-webkit-transform: translateZ(0px) translateY(0px); '+
'} '+
'} '+
'@-webkit-keyframes motion-blur-number-'+i+' { ' +
' 0% { '+
'opacity: 0;'+
'color: '+$rgbaColorStart+'; '+
'text-shadow: 0 '+$numberSize/20+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/10+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/6+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/5+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/4+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/20+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/10+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/6+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/5+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/4+'px 0 '+$rgbaColorStart+'; '+
'transform: translateZ(0px) translateY(-100%); '+
'-webkit-transform: translateZ(0px) translateY(-100%); '+
'} '+
'33% { opacity: 1 }' +
'100% { '+
'color: '+$rgbaColorEnd+'; '+
'text-shadow: none; '+
'transform: translateZ(0px) translateY(0px); '+
'-webkit-transform: translateZ(0px) translateY(0px); '+
'} '+
'} '+
'.nectar-milestone.motion_blur.instance-'+i+' .number span.in-sight { animation: 0.65s cubic-bezier(0, 0, 0.17, 1) 0s normal backwards 1 motion-blur-number-'+i+'; -webkit-animation: 0.65s cubic-bezier(0, 0, 0.17, 1) 0s normal backwards 1 motion-blur-number-'+i+'; } ';
$symbol=$(this).find('.symbol-wrap').clone();
$(this).find('.symbol-wrap').remove();
var characters=$(this).find('.number').text().split("");
$this=$(this).find('.number');
$this.empty();
$.each(characters, function (i, el){
$this.append("
" + el + " 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
var $endNum=parseInt($that.find('.number span:not(.symbol)').text());
if(!$that.hasClass('motion_blur')){
$that.find('.number span:not(.symbol)').countTo({
from: 0,
to: $endNum,
speed: 1500,
refreshInterval: 30
});
}else{
$that.find('span').each(function(i){
var $that=$(this);
setTimeout(function(){ $that.addClass('in-sight'); },200*i);
});
}
$that.addClass('animated-in');
waypoint.destroy();
},
offset: 'bottom-in-view'
});
});
}
var $animationOnScrollTimeOut=($('.nectar-box-roll').length > 0) ? 850: 125;
$tabbedClickCount=0;
$('body').on('click','.tabbed > ul li:not(.cta-button) a',function(){
var $id=$(this).parents('li').index()+1;
if(!$(this).hasClass('active-tab')&&!$(this).hasClass('loading')){
$(this).parents('ul').find('a').removeClass('active-tab');
$(this).addClass('active-tab');
$(this).parents('.tabbed').find('> div:not(.clear)').css({'visibility':'hidden','position':'absolute','opacity':'0','left':'-9999px','display':'none'});
$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').css({'visibility':'visible', 'position':'relative','left':'0','display':'block'}).stop().transition({'opacity':1},300);
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+') .iframe-embed').length > 0||$(this).parents('.tabbed').find('> div:nth-of-type('+$id+') .portfolio-items').length > 0) setTimeout(function(){ $(window).resize(); },10);
}
if($tabbedClickCount!=0){
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-progress-bar').length > 0)
progressBars();
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.divider-small-border [data-animate="yes"]').length > 0||$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.divider-border [data-animate="yes"]').length > 0)
dividers();
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('img.img-with-animation').length > 0 ||
$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.col.has-animation').length > 0 ||
$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar_cascading_images').length > 0 ||
$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.wpb_column.has-animation').length > 0){
colAndImgAnimations();
cascadingImageBGSizing();
}
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-milestone').length > 0)
milestoneWaypoint();
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar_image_with_hotspots[data-animation="true"]').length > 0)
imageWithHotspots();
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-fancy-ul').length > 0)
nectar_fancy_ul_init();
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-split-heading').length > 0)
splitLineHeadings();
if($(this).parents('.wpb_row').length > 0){
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.vc_pie_chart').length > 0 ||
$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.wp-video-shortcode').length > 0 ||
$(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.twentytwenty-container').length > 0 ||
$(this).parents('.wpb_row').next().hasClass('parallax_section'))
$(window).trigger('resize');
if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-flickity').length > 0)
$('.nectar-flickity:not(.masonry)').flickity('resize');
}}
$(this).parents('.tabbed').find('.wpb_row').each(function(){
if(typeof $(this).find('[class*="vc_col-"]').first().offset()!='undefined'){
var $firstChildOffset=$(this).find('[class*="vc_col-"]').first().offset().left;
$(this).find('[class*="vc_col-"]').each(function(){
$(this).removeClass('no-left-margin');
if($(this).offset().left < $firstChildOffset + 15){
$(this).addClass('no-left-margin');
}else{
$(this).removeClass('no-left-margin');
}});
}});
$tabbedClickCount++;
return false;
});
function tabbedInit(){
$('.tabbed').each(function(){
if($(this).find('.swiper-container').length==0&&$(this).find('.testimonial_slider').length==0&&$(this).find('.portfolio-items:not(".carousel")').length==0&&$(this).find('.wpb_gallery .portfolio-items').length==0&&$(this).find('iframe').length==0){
$(this).find('> ul li:first-child a').click();
}
if($(this).find('.testimonial_slider').length > 0||$(this).find('.portfolio-items:not(".carousel")').length > 0||$(this).find('.wpb_gallery .portfolio-items').length > 0||$(this).find('iframe').length > 0){
var $that=$(this);
$(this).find('.wpb_tab').show().css({'opacity':0,'height':'1px'});
$(this).find('> ul li a').addClass('loading');
setTimeout(function(){
$that.find('.wpb_tab').hide().css({'opacity':1,'height':'auto'});
$that.find('> ul li a').removeClass('loading');
$that.find('> ul li:first-child a').click();
},900);
}});
}
tabbedInit();
function tabbbedDeepLinking(){
if(typeof $_GET['tab']!='undefined'){
$('.wpb_tabs_nav').each(function(){
$(this).find('li').each(function(){
var $currentText=$(this).find('a').text();
var $getText=$_GET['tab'];
var $that=$(this);
$currentText=$currentText.replace(/\s+/g, '-').toLowerCase();
$getText=$getText.replace(/\s+/g, '-').replace(/ div').slideToggle(300);
$(this).parents('.toggle').toggleClass('open');
if($(this).parents('.toggle').hasClass('open')){
$(this).find('i').attr('class','icon-minus-sign');
}else{
$(this).find('i').attr('class','icon-plus-sign');
}
if($(this).parents('.toggle').find('> div .iframe-embed').length > 0&&$(this).parents('.toggle').find('> div .iframe-embed iframe').height()=='0') responsiveVideoIframes();
if($(this).parents('.full-width-content').length > 0) setTimeout(function(){ fullWidthContentColumns(); },300);
if($('#nectar_fullscreen_rows').length > 0) setTimeout(function(){ $(window).trigger('smartresize'); },300);
return false;
}});
$('body').on('click','.accordion .toggle h3 a', function(){
if($(this).parents('.toggle').hasClass('open')) return false;
$(this).parents('.toggles').find('.toggle > div').slideUp(300);
$(this).parents('.toggles').find('.toggle h3 a i').attr('class','icon-plus-sign');
$(this).parents('.toggles').find('.toggle').removeClass('open');
$(this).parents('.toggle').find('> div').slideDown(300);
$(this).parents('.toggle').addClass('open');
if($(this).parents('.toggle').hasClass('open')){
$(this).find('i').attr('class','icon-minus-sign');
}else{
$(this).find('i').attr('class','icon-plus-sign');
}
if($(this).parents('.full-width-content').length > 0){
clearTimeout($t);
var $t=setTimeout(function(){ fullWidthContentColumns(); },400);
}
if($('#nectar_fullscreen_rows').length > 0){
clearTimeout($t);
var $t=setTimeout(function(){ $(window).trigger('smartresize'); },400);
}
return false;
});
function accordionInit(){
$('.accordion').each(function(){
$(this).find('> .toggle').first().addClass('open').find('> div').show();
$(this).find('> .toggle').first().find('a i').attr('class','icon-minus-sign');
});
$('.toggles').each(function(){
var $isAccordion=($(this).hasClass('accordion')) ? true:false;
$(this).find('.toggle').each(function(){
if($(this).find('> div .testimonial_slider').length > 0||$(this).find('> div iframe').length > 0){
var $that=$(this);
$(this).find('> div').show().css({'opacity':0,'height':'1px', 'padding':'0'});
testimonialHeightResize();
setTimeout(function(){
$that.find('> div').hide().css({'opacity':1,'height':'auto', 'padding':'10px 14px'});
if($isAccordion==true&&$that.index()==0) $that.find('> div').slideDown(300);
},900);
}});
})
}
accordionInit();
function accordionDeepLinking(){
if(typeof $_GET['toggle']!='undefined'){
$('.toggles').each(function(){
$(this).find('.toggle').each(function(){
var $currentText=$(this).find('h3 a').clone();
var $getText=$_GET['toggle'];
$($currentText).find('i').remove();
$currentText=$currentText.text();
$currentText=$currentText.replace(/\s+/g, '-').toLowerCase();
$getText=$getText.replace(/\s+/g, '-').replace(/ 0)
var $color='#000000';
else
var $color='#ffffff';
}
if(!$(this).hasClass('see-through-3')) $(this).css('color',$color);
$(this).find('i').css('color',$color);
var colorInt=parseInt($color.substring(1),16);
var $hoverColor=($(this).has('[data-hover-color-override]')) ? $(this).attr('data-hover-color-override'):'no-override';
var $hoverTextColor=($(this).has('[data-hover-text-color-override]')) ? $(this).attr('data-hover-text-color-override'):'#fff';
var R=(colorInt & 0xFF0000) >> 16;
var G=(colorInt & 0x00FF00) >> 8;
var B=(colorInt & 0x0000FF) >> 0;
$opacityStr=($(this).hasClass('see-through-3')) ? '1': '0.75';
$(this).css('border-color','rgba('+R+','+G+','+B+','+$opacityStr+')');
if($(this).hasClass('see-through')){
$(this).hover(function(){
$(this).css('border-color','rgba('+R+','+G+','+B+',1)');
},function(){
$(this).css('border-color','rgba('+R+','+G+','+B+','+$opacityStr+')');
});
}else{
$(this).find('i').css('color', $hoverTextColor);
if($hoverColor!='no-override'){
$(this).hover(function(){
$(this).css({
'border-color': $hoverColor,
'background-color': $hoverColor,
'color': $hoverTextColor
});
},function(){
$opacityStr=($(this).hasClass('see-through-3')) ? '1': '0.75';
if(!$(this).hasClass('see-through-3')){
$(this).css({
'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')',
'background-color': 'transparent',
'color': $color
});
}else{
$(this).css({
'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')',
'background-color': 'transparent'
});
}});
}else{
$(this).hover(function(){
$(this).css({
'border-color': $hoverColor,
'color': $hoverTextColor
});
},function(){
$opacityStr=($(this).hasClass('see-through-3')) ? '1': '0.75';
$(this).css({
'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')',
'color': $hoverTextColor
});
});
}}
});
$('.nectar-button:not(.see-through):not(.see-through-2):not(.see-through-3)[data-color-override]').each(function(){
$(this).css('visibility','visible');
if($(this).attr('data-color-override')!='false'){
var $color=$(this).attr('data-color-override');
$(this).removeClass('accent-color').removeClass('extra-color-1').removeClass('extra-color-2').removeClass('extra-color-3');
$(this).css('background-color',$color);
}});
if($('.swiper-slide .solid_color_2').length > 0||$('.tilt-button-inner').length > 0){
var $tiltButtonCssString='';
$('.swiper-slide .solid_color_2 a').each(function(i){
$(this).addClass('instance-'+i);
if($(this).attr('data-color-override')!='false'){
var $color=$(this).attr('data-color-override');
}else{
if($(this).parents('.dark').length > 0)
var $color='#000000';
else
var $color='#ffffff';
}
$(this).css('color',$color);
$(this).find('i').css('color',$color);
var $currentColor=$(this).css('background-color');
var $topColor=shadeColor($currentColor, 0.13);
var $bottomColor=shadeColor($currentColor, -0.15);
$tiltButtonCssString +='.swiper-slide .solid_color_2 a.instance-'+i + ':after { background-color: '+$topColor+'; }' + ' .swiper-slide .solid_color_2 a.instance-'+i + ':before { background-color: '+$bottomColor+'; } ';
});
$('.tilt-button-wrap a').each(function(i){
$(this).addClass('instance-'+i);
var $currentColor=$(this).css('background-color');
if($(this).attr('data-color-override')!='false'){
var $color=$(this).attr('data-color-override');
$(this).css('background-color',$color);
$currentColor=$color;
}
var $topColor=shadeColor($currentColor, 0.13);
var $bottomColor=shadeColor($currentColor, -0.15);
$tiltButtonCssString +='.tilt-button-wrap a.instance-'+i + ':after { background-color: '+$topColor+'; }' + ' .tilt-button-wrap a.instance-'+i + ':before { background-color: '+$bottomColor+'; } ';
});
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=$tiltButtonCssString;
}else{
style.appendChild(document.createTextNode($tiltButtonCssString));
}
head.appendChild(style);
}
if($('.nectar-3d-transparent-button').length > 0){
var $3dTransButtonCssString='';
$('.nectar-3d-transparent-button').each(function(i){
var $that=$(this);
var $size=$that.attr('data-size');
var $padding=0;
if($size=='large'){
$padding=46;
$font_size=16;
}else if($size=='medium'){
$padding=30;
$font_size=16;
}else if($size=='small'){
$padding=20;
$font_size=12;
}else if($size=='jumbo'){
$padding=54;
$font_size=24;
}else if($size=='extra_jumbo'){
$padding=100;
$font_size=64;
}
$that.find('svg text').attr('font-size',$font_size);
$boundingRect=$(this).find('.back-3d .button-text')[0].getBoundingClientRect();
$text_width=$boundingRect.width;
$text_height=$font_size*1.5;
$extraMult=(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) ? 0:1;
$that.css({'width': ($text_width+$padding*1.5)+'px','height': ($text_height+$padding)+'px'});
$that.find('> a').css({'height': ($text_height+$padding)+'px'});
$that.find('.back-3d svg, .front-3d svg').css({'width': ($text_width+$padding*1.5)+'px','height': ($text_height+$padding)+'px'}).attr('viewBox','0 0 '+ ($text_width+$padding) + ' ' + ($text_height+$padding));
if($size=='jumbo')
$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.5)/2 +' ' + (($text_height+$padding) / 1.68) +')');
else if($size=='extra_jumbo')
$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.6)/2 +' ' + (($text_height+$padding) / 1.6) +')');
else if($size=='large'){
$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.5)/2 +' ' + (($text_height+$padding) / 1.7) +')');
}else{
$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.5)/2 +' ' + (($text_height+$padding) / 1.65) +')');
}
$that.find('.front-3d ').css('transform-origin','50% 50% -'+($text_height+$padding)/2+'px');
$that.find('.back-3d').css('transform-origin','50% 50% -'+($text_height+$padding)/2+'px');
$(this).find('.front-3d svg > rect').attr('id','masked-rect-id-'+i);
$(this).find('.front-3d defs mask').attr('id','button-text-mask-'+i);
$that.css('visibility','visible');
$3dTransButtonCssString+='#masked-rect-id-'+i+' { mask: url(#button-text-mask-'+i+'); -webkit-mask: url(#button-text-mask-'+i+')} ';
});
function createExtraJumboSize(){
$('.nectar-3d-transparent-button').each(function(i){
if($(this).css('visibility')!='visible') return;
var $that=$(this);
var $size=$that.attr('data-size');
if($size=='extra_jumbo'){
$extraMult=(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) ? 0:1;
if(window.innerWidth < 1000&&window.innerWidth > 690){
$padding=64;
$font_size=34;
$that.find('.back-3d rect').attr('stroke-width','12');
$vert_height_divider=1.7;
}else if(window.innerWidth <=690){
$padding=46;
$font_size=16;
$that.find('.back-3d rect').attr('stroke-width','10');
$vert_height_divider=1.7;
}else{
$padding=100;
$font_size=64;
$that.find('.back-3d rect').attr('stroke-width','20');
$vert_height_divider=1.6;
}
$that.find('svg text').attr('font-size',$font_size);
$boundingRect=$(this).find('.back-3d .button-text')[0].getBoundingClientRect();
$text_width=$boundingRect.width;
$text_height=$font_size*1.5;
$that.css({'width': ($text_width+$padding*1.5)+'px','height': ($text_height+$padding)+'px'});
$that.find('> a').css({'height': ($text_height+$padding)+'px'});
$that.find('.back-3d svg, .front-3d svg').css({'width': ($text_width+$padding*1.5)+'px','height': ($text_height+$padding)+'px'}).attr('viewBox','0 0 '+ ($text_width+$padding) + ' ' + ($text_height+$padding));
$that.find('svg text').attr('transform','matrix(1 0 0 1 '+($text_width+$padding*1.6)/2 +' ' + (($text_height+$padding) / $vert_height_divider) +')');
$that.find('.front-3d ').css('transform-origin','50% 50% -'+($text_height+$padding)/2+'px');
$that.find('.back-3d').css('transform-origin','50% 50% -'+($text_height+$padding)/2+'px');
}});
}
createExtraJumboSize();
$(window).on('smartresize',createExtraJumboSize);
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=$3dTransButtonCssString;
}else{
style.appendChild(document.createTextNode($3dTransButtonCssString));
}
head.appendChild(style);
}
setTimeout(function(){
$('.nectar-button.extra-color-gradient-1 .start, .nectar-button.extra-color-gradient-2 .start, .nectar-button.see-through-extra-color-gradient-1 .start, .nectar-button.see-through-extra-color-gradient-2 .start').removeClass('loading');
},150);
if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1||navigator.userAgent.indexOf("MSIE ") > -1||navigator.userAgent.match(/Trident\/7\./)){
$('.nectar-button.extra-color-gradient-1, .nectar-button.extra-color-gradient-2, .nectar-button.see-through-extra-color-gradient-1, .nectar-button.see-through-extra-color-gradient-2').addClass('no-text-grad');
}}
coloredButtons();
function largeIconHover(){
$('.icon-3x').each(function(){
$(this).closest('.col').hover(function(){
$(this).find('.icon-3x').addClass('hovered')
},function(){
$('.icon-3x').removeClass('hovered')
});
});
if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1||navigator.userAgent.indexOf("MSIE ") > -1||navigator.userAgent.match(/Trident\/7\./))
$('[class^="icon-"].extra-color-gradient-1, [class^="icon-"].extra-color-gradient-2, [class^="icon-"][data-color="extra-color-gradient-1"], [class^="icon-"][data-color="extra-color-gradient-2"], .nectar-gradient-text').addClass('no-grad');
}
largeIconHover();
function columnBGColors(){
var $columnColorCSS='';
$('.wpb_column').each(function(i){
$(this).addClass('instance-'+i);
if($(this).attr('data-has-bg-color')=='true'){
if($(this).is('[data-animation*="reveal"]')&&$(this).hasClass('has-animation'))
$columnColorCSS +='.wpb_column.instance-'+i+ ' .column-inner-wrap .column-inner:before { background-color:' + $(this).attr('data-bg-color') + '; opacity: '+$(this).attr('data-bg-opacity')+'; }';
else
$columnColorCSS +='.wpb_column.instance-'+i+ ':before { background-color:' + $(this).attr('data-bg-color') + '; opacity: '+$(this).attr('data-bg-opacity')+'; }';
}
if($(this).is('[data-hover-bg^="#"]')){
if($(this).is('[data-animation*="reveal"]')&&$(this).hasClass('has-animation'))
$columnColorCSS +='.wpb_column.instance-'+i+ ':hover .column-inner:before { background-color: '+$(this).attr('data-hover-bg') + '; opacity: '+$(this).attr('data-hover-bg-opacity')+'; }';
else
$columnColorCSS +='.wpb_column.instance-'+i+ ':hover:before { background-color: '+$(this).attr('data-hover-bg') + '; opacity: '+$(this).attr('data-hover-bg-opacity')+'; }';
}});
if($columnColorCSS.length > 1){
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=$columnColorCSS;
}else{
style.appendChild(document.createTextNode($columnColorCSS));
}
head.appendChild(style);
}}
columnBGColors();
function rowColorOverlay(){
var $rowOverlayCSS='';
$('.row > .wpb_row > .row-bg-wrap > .row-bg[data-color_overlay], #nectar_fullscreen_rows .full-page-inner-wrap > .full-page-inner > .row-bg-wrap > .row-bg[data-color_overlay], #portfolio-extra > .wpb_row > .row-bg-wrap > .row-bg[data-color_overlay], .single #post-area .content-inner > .wpb_row > .row-bg-wrap > .row-bg[data-color_overlay]').each(function(i){
$(this).parent().addClass('instance-'+i);
$overlayOpacity=($(this).attr('data-overlay_strength').length > 0) ? $(this).attr('data-overlay_strength'):'1';
$overlay1=($(this).attr('data-color_overlay').length > 0) ? $(this).attr('data-color_overlay'):'transparent';
$overlay2=($(this).attr('data-color_overlay_2').length > 0) ? $(this).attr('data-color_overlay_2'):'transparent';
$gradientDirection=($(this).attr('data-gradient_direction').length > 0) ? $(this).attr('data-gradient_direction'):'left_t_right';
switch($gradientDirection){
case 'left_to_right' :
var $gradientDirectionDeg='90deg';
break;
case 'left_t_to_right_b' :
var $gradientDirectionDeg='135deg';
break;
case 'left_b_to_right_t' :
var $gradientDirectionDeg='45deg';
break;
case 'top_to_bottom' :
var $gradientDirectionDeg='to bottom';
break;
}
$enableGradient=($(this).attr('data-enable_gradient')=='true') ? true:false;
if($enableGradient){
if($overlay1=='#ffffff'&&$overlay2=='transparent') $overlay2='rgba(255,255,255,0.001)';
if($overlay1=='transparent'&&$overlay2=='#ffffff') $overlay1='rgba(255,255,255,0.001)';
if($gradientDirection=='top_to_bottom'){
if($overlay2=='transparent'||$overlay2=='rgba(255,255,255,0.001)') $rowOverlayCSS +='.row-bg-wrap.instance-'+i+ ':after { background: linear-gradient('+$gradientDirectionDeg+',' + $overlay1 + ' 0%,' + $overlay2 + ' 75%); opacity: '+$overlayOpacity+'; }';
if($overlay1=='transparent'||$overlay1=='rgba(255,255,255,0.001)') $rowOverlayCSS +='.row-bg-wrap.instance-'+i+ ':after { background: linear-gradient('+$gradientDirectionDeg+',' + $overlay1 + ' 25%,' + $overlay2 + ' 100%); opacity: '+$overlayOpacity+'; }';
if($overlay1!='transparent'&&$overlay2!='transparent') $rowOverlayCSS +='.row-bg-wrap.instance-'+i+ ':after { background: '+$overlay1+'; background: linear-gradient('+$gradientDirectionDeg+',' + $overlay1 + ' 0%,' + $overlay2 + ' 100%); opacity: '+$overlayOpacity+'; }';
} else
$rowOverlayCSS +='.row-bg-wrap.instance-'+i+ ':after { background: '+$overlay1+'; background: linear-gradient('+$gradientDirectionDeg+',' + $overlay1 + ' 0%,' + $overlay2 + ' 100%); opacity: '+$overlayOpacity+'; }';
}else{
if($(this).attr('data-color_overlay').length > 0){
$rowOverlayCSS +='.row-bg-wrap.instance-'+i+ ':after { background-color:' + $overlay1 + '; opacity: '+$overlayOpacity+'; }';
}}
});
if($rowOverlayCSS.length > 1){
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=$rowOverlayCSS;
}else{
style.appendChild(document.createTextNode($rowOverlayCSS));
}
head.appendChild(style);
}}
rowColorOverlay();
function morphingOutlines(){
if($('.morphing-outline').length > 0){
$morphingOutlineCSS='';
$('.morphing-outline').each(function(i){
$(this).addClass('instance-'+i).css({'visibility':'visible'});
var $width=$(this).find('.inner').width();
var $height=$(this).find('.inner').height();
var $border=parseInt($(this).attr("data-border-thickness"));
var $hover=($('body[data-button-style="rounded"]').length > 0) ? ':hover': '';
var $hover2=($('body[data-button-style="rounded"]').length > 0) ? '': ':hover';
$morphingOutlineCSS +='body .morphing-outline.instance-'+i+' .inner > * { color: '+$(this).attr("data-starting-color")+'; } ';
$morphingOutlineCSS +='body .morphing-outline.instance-'+i+' .inner:after { border-width:'+$(this).attr("data-border-thickness")+'px ; border-color: '+$(this).attr("data-starting-color")+'; } ';
$morphingOutlineCSS +='body .wpb_column:hover > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner > *, body .wpb_column:hover > .vc_column-inner > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner > * { color: '+$(this).attr("data-hover-color")+'; } ';
$morphingOutlineCSS +='body .wpb_column:hover > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after, body .wpb_column:hover > .vc_column-inner > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { border-color: '+$(this).attr("data-hover-color")+'; } ';
$morphingOutlineCSS +='body .wpb_column'+$hover2+' > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after, body .wpb_column'+$hover2+' > .vc_column-inner > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { padding: '+(($width+100 + $border*2 - $height)/2 - $border) +'px 50px}';
$morphingOutlineCSS +='.morphing-outline.instance-'+i+' { padding: '+(30+($width+80 + $border*2 - $height)/2 - $border) +'px 50px}';
$morphingOutlineCSS +='body .wpb_column'+$hover2+' > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after, body .wpb_column'+$hover2+' > .vc_column-inner > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { top: -'+ parseInt((($width+100 + $border*2 - $height)/2 - $border) + $border)+ 'px }';
$morphingOutlineCSS +='body .wpb_column > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after, body .wpb_column > .vc_column-inner > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { left: -' + parseInt(50+$border) + 'px }';
$morphingOutlineCSS +='body .wpb_column'+$hover+' > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after, body .wpb_column'+$hover+' > .vc_column-inner > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { padding: 50px 50px}';
$morphingOutlineCSS +='body .wpb_column'+$hover+' > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after, body .wpb_column'+$hover+' > .vc_column-inner > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { top: -'+parseInt(50+$border) +'px }';
});
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
style.id='morphing-outlines';
if(style.styleSheet){
style.styleSheet.cssText=$morphingOutlineCSS;
}else{
style.appendChild(document.createTextNode($morphingOutlineCSS));
}
$('#morphing-outlines').remove();
head.appendChild(style);
}}
setTimeout(morphingOutlines,100);
setTimeout(fullWidthContentColumns,126);
var $svg_icons=[];
function svgAnimations(){
$svgOffsetPos=($('#nectar_fullscreen_rows').length > 0) ? '200%':'bottom-in-view';
if($svg_icons.length==0){
$('.svg-icon-holder:not(.animated-in)').each(function(i){
var $that=$(this);
if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) $that.attr('data-animation','false');
$that.css({'height': parseInt($that.attr('data-size')) +'px', 'width': parseInt($that.attr('data-size')) +'px'});
$(this).attr('id','nectar-svg-animation-instance-'+i);
var $animationSpeed=($that.is('[data-animation-speed]')&&$that.attr('data-animation-speed').length > 0) ? $that.attr('data-animation-speed'):200;
if($that.attr('data-animation')=='false'){
$animationSpeed=1;
$that.css('opacity','1');
}
if(!$that.hasClass('bound'))
$svg_icons[i]=new Vivus($that.attr('id'), {type: 'delayed', pathTimingFunction: Vivus.EASE_OUT, animTimingFunction: Vivus.LINEAR, duration: $animationSpeed, file: $that.text(), onReady: svgInit });
$that.find('span').remove();
if($animationSpeed!==1){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
checkIfReady();
$that.addClass('animated-in');
waypoint.destroy();
},
offset: $svgOffsetPos
});
}else{
checkIfReady();
}
function checkIfReady(){
var $animationDelay=($that.is('[data-animation-delay]')&&$that.attr('data-animation-delay').length > 0&&$that.attr('data-animation')!='false') ? $that.attr('data-animation-delay'):0;
if($svg_icons[$that.attr('id').slice(-1)].isReady==true){
$that.css('opacity','1');
setTimeout(function(){ $svg_icons[$that.attr('id').slice(-1)].reset().play(); },$animationDelay);
}else{
setTimeout(checkIfReady,50);
}}
function svgInit(){
$that.find('object').css({'height': parseInt($that.attr('data-size')) +'px', 'width': parseInt($that.attr('data-size')) +'px'});
$svg_icons[$that.attr('id').slice(-1)].reset().stop();
var svgDoc=$that.find('object')[0].contentDocument;
var styleElement=svgDoc.createElementNS("http://www.w3.org/2000/svg", "style");
styleElement.textContent="svg, svg path { stroke: "+$that.css('color')+"; fill: none; }";
svgDoc.getElementById("Layer_1").appendChild(styleElement);
}
$that.addClass('bound');
});
}else{
$('.svg-icon-holder').addClass('animated-in').css('opacity','1');
}
$('.svg-icon-holder.animated-in').each(function(i){
var $animationDelay=($(this).is('[data-animation-delay]')&&$(this).attr('data-animation-delay').length > 0&&$(this).attr('data-animation')!='false') ? $(this).attr('data-animation-delay'):0;
var $that=$(this);
if($that.attr('data-animation')=='false'){
$animationSpeed=1;
$that.css('opacity','1');
$svg_icons[$that.attr('id').slice(-1)].finish();
}else{
if($(this).parents('.active').length > 0||$(this).parents('#footer-outer').length > 0||$('body.mobile').length > 0){
$svg_icons[$that.attr('id').slice(-1)].reset();
setTimeout(function(){ $svg_icons[$that.attr('id').slice(-1)].play(); },$animationDelay);
}else{
$svg_icons[$(this).attr('id').slice(-1)].reset().stop();
}}
});
}
function nectar_fancy_ul_init(){
$($fullscreenSelector+'.nectar-fancy-ul').each(function(){
var $icon=$(this).attr('data-list-icon');
var $color=$(this).attr('data-color');
var $animation=$(this).attr('data-animation');
var $animationDelay=($(this).is('[data-animation-delay]')&&$(this).attr('data-animation-delay').length > 0&&$(this).attr('data-animation')!='false') ? $(this).attr('data-animation-delay'):0;
$(this).find('li').each(function(){
if($(this).find('> i').length==0)
$(this).prepend('
');
});
if($animation=='true'){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
setTimeout(function(){
$that.find('li').each(function(i){
var $that=$(this);
$that.delay(i*220).transition({
'opacity': '1',
'left':'0'
},220,'easeOutCubic');
});
},$animationDelay);
$that.addClass('animated-in');
waypoint.destroy();
},
offset: 'bottom-in-view'
});
}});
}
setTimeout(function(){
},$animationOnScrollTimeOut);
function flipBoxHeights(){
$('.nectar-flip-box').each(function(){
var $flipBoxMinHeight=parseInt($(this).attr('data-min-height'));
var $flipBoxHeight=($(this).find('.flip-box-back .inner').height() > $(this).find('.flip-box-front .inner').height()) ? $(this).find('.flip-box-back .inner').height():$(this).find('.flip-box-front .inner').height();
if($flipBoxHeight >=$flipBoxMinHeight - 80){
$(this).find('> div').css('height', $flipBoxHeight + 80);
} else
$(this).find('> div').css('height','auto');
});
}
flipBoxHeights();
if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)){
$('.nectar-flip-box').on('click',function(){
$(this).toggleClass('flipped');
});
}
window.requestAnimationFrame=window.requestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.msRequestAnimationFrame
|| function(f){setTimeout(f, 1000/60)}
var $window=$(window);
var windowHeight=$window.height();
$window.unbind('scroll.parallaxSections').unbind('resize.parallaxSections');
$window.unbind('resize.parallaxSectionsUpdateHeight');
$window.unbind('load.parallaxSectionsOffsetL');
$window.unbind('resize.parallaxSectionsOffsetR');
$window.on('resize.parallaxSectionsUpdateHeight',psUpdateWindowHeight);
function psUpdateWindowHeight(){
windowHeight=$window.height();
}
function psUpdateOffset($this){
$this.each(function(){
firstTop=$this.offset().top;
});
}
$.fn.parallaxScroll=function(xpos, speedFactor, outerHeight){
var $this=$(this);
var getHeight;
var firstTop;
var paddingTop=0;
$this.each(function(){
firstTop=$this.offset().top;
});
$window.on('resize.parallaxSectionsOffsetR',psUpdateOffset($this));
$window.on('load.parallaxSectionsOffsetL',psUpdateOffset($this));
getHeight=function(jqo){
return jqo.outerHeight(true);
};
if(arguments.length < 1||xpos===null) xpos="50%";
if(arguments.length < 2||speedFactor===null) speedFactor=0.1;
if(arguments.length < 3||outerHeight===null) outerHeight=true;
var $element, top, height, pos;
function update(){
pos=$window.scrollTop();
$this.each(function(){
firstTop=$this.offset().top;
$element=$(this);
top=$element.offset().top;
height=getHeight($element);
if(top + height < pos||top > pos + windowHeight){
return;
}
var ua=window.navigator.userAgent;
var msie=ua.indexOf("MSIE ");
if(msie > 0||!!navigator.userAgent.match(/Trident.*rv\:11\./)||$smoothCache==true||navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1){
$this.find('.row-bg.using-image').css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px");
}else{
var $ifFast=($this.find('.row-bg[data-parallax-speed="fast"]').length > 0) ? ($element.find('.row-bg').height() - height)/2:0;
$this.find('.row-bg.using-image').addClass('translate').css({ 'transform': 'translate3d(0, ' + Math.round(((window.innerHeight + pos - firstTop) * speedFactor) -($ifFast)) + 'px, 0), scale(1.005)' });
}});
}
if(window.addEventListener){
window.addEventListener('scroll', function(){
requestAnimationFrame(update);
}, false);
}
$window.on('resize.parallaxSections',update);
update();
};
function fullWidthSections(){
var $scrollBar=($('#ascrail2000').length > 0&&window.innerWidth > 1000) ? -13:4;
if($('#boxed').length==1){
$justOutOfSight=((parseInt($('.container-wrap').width()) - parseInt($('.main-content').width())) / 2) + 4;
}else{
var $extResponsivePadding=($('body[data-ext-responsive="true"]').length > 0&&window.innerWidth >=1000) ? 180:0;
if($(window).width() <=parseInt($('.main-content').css('max-width'))){
var $windowWidth=parseInt($('.main-content').css('max-width'));
if($extResponsivePadding==180) $windowWidth=$windowWidth - $scrollBar;
}else{
var $windowWidth=$(window).width();
}
$contentWidth=parseInt($('.main-content').css('max-width'));
if($('body.single-post[data-ext-responsive="true"]').length > 0&&$('.container-wrap.no-sidebar').length > 0){
$contentWidth=$('#post-area').width();
$extResponsivePadding=0;
}
$justOutOfSight=Math.ceil((($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2))
}
$('.full-width-section').each(function(){
if(!$(this).parents('.span_9').length > 0&&!$(this).parent().hasClass('span_3')&&$(this).parent().attr('id')!='sidebar-inner'&&$(this).parent().attr('id')!='portfolio-extra' &&
!$(this).hasClass('non-fw')){
$(this).css({
'margin-left': - $justOutOfSight,
'padding-left': $justOutOfSight,
'padding-right': $justOutOfSight,
'visibility': 'visible'
});
if($('#boxed').length > 0&&$('#nectar_fullscreen_rows').length > 0) $(this).css({ 'padding-left': 0, 'padding-right': 0 });
}else if($(this).parent().attr('id')=='portfolio-extra'&&$('#full_width_portfolio').length!=0){
$(this).css({
'margin-left': - $justOutOfSight,
'padding-left': $justOutOfSight,
'padding-right': $justOutOfSight,
'visibility': 'visible'
});
}else{
$(this).css({
'margin-left': 0,
'padding-left': 0,
'padding-right': 0,
'visibility': 'visible'
});
}});
$('.carousel-outer').has('.carousel-wrap[data-full-width="true"]').css('overflow','visible');
$('.carousel-wrap[data-full-width="true"], .portfolio-items[data-col-num="elastic"], .full-width-content').each(function(){
if($('#boxed').length==1){
var $mainContentWidth=($('#nectar_fullscreen_rows').length==0) ? parseInt($('.main-content').width()):parseInt($(this).parents('.container').width());
if($('body.single-post[data-ext-responsive="true"]').length > 0&&$('.container-wrap.no-sidebar').length > 0&&$(this).parents('#post-area').length > 0){
$contentWidth=$('#post-area').width();
$extResponsivePadding=0;
$windowWidth=$(window).width();
$justOutOfSight=Math.ceil((($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2))
}else{
$justOutOfSight=((parseInt($('.container-wrap').width()) - $mainContentWidth) / 2) + 4;
}}else{
if($('body.single-post[data-ext-responsive="true"]').length > 0&&$('.container-wrap.no-sidebar').length > 0&&$(this).parents('#post-area').length > 0){
$contentWidth=$('#post-area').width();
$extResponsivePadding=0;
$windowWidth=$(window).width();
}else{
var $mainContentMaxWidth=($('#nectar_fullscreen_rows').length==0) ? parseInt($('.main-content').css('max-width')):parseInt($(this).parents('.container').css('max-width'));
if($(window).width() <=$mainContentMaxWidth){
$windowWidth=$mainContentMaxWidth;
if($extResponsivePadding==180) $windowWidth=$windowWidth - $scrollBar;
}
$contentWidth=$mainContentMaxWidth;
$extResponsivePadding=($('body[data-ext-responsive="true"]').length > 0&&window.innerWidth >=1000) ? 180:0;
}
$justOutOfSight=Math.ceil((($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2))
}
$extraSpace=($(this).hasClass('carousel-wrap')) ? 1:4;
$carouselWidth=($('#boxed').length==1) ? $mainContentWidth + parseInt($justOutOfSight*2):$(window).width() +$extraSpace + $scrollBar ;
if($(this).parent().hasClass('default-style')){
var $mainContentWidth=($('#nectar_fullscreen_rows').length==0) ? parseInt($('.main-content').width()):parseInt($(this).parents('.container').width());
if($('#boxed').length!=0){
$carouselWidth=($('#boxed').length==1) ? $mainContentWidth + parseInt($justOutOfSight*2):$(window).width() + $extraSpace + $scrollBar ;
}else{
$carouselWidth=($('#boxed').length==1) ? $mainContentWidth + parseInt($justOutOfSight*2):$(window).width() - ($(window).width()*.025) + $extraSpace + $scrollBar ;
$windowWidth=($(window).width() <=$mainContentWidth) ? $mainContentWidth:$(window).width() - ($(window).width()*.025);
$justOutOfSight=Math.ceil((($windowWidth + $scrollBar - $mainContentWidth) / 2))
}}
else if($(this).parent().hasClass('spaced')){
var $mainContentWidth=($('#nectar_fullscreen_rows').length==0) ? parseInt($('.main-content').width()):parseInt($(this).parents('.container').width());
if($('#boxed').length!=0){
$carouselWidth=($('#boxed').length==1) ? $mainContentWidth + parseInt($justOutOfSight*2) - ($(window).width()*.02):$(window).width() + $extraSpace + $scrollBar ;
}else{
$carouselWidth=($('#boxed').length==1) ? $mainContentWidth + parseInt($justOutOfSight*2):$(window).width() - Math.ceil($(window).width()*.02) + $extraSpace + $scrollBar ;
var $windowWidth2=($(window).width() <=$mainContentWidth) ? $mainContentWidth:$(window).width() - ($(window).width()*.02);
$justOutOfSight=Math.ceil((($windowWidth2 + $scrollBar - $mainContentWidth) / 2) +2)
}}
if(!$(this).parents('.span_9').length > 0&&!$(this).parent().hasClass('span_3')&&$(this).parent().attr('id')!='sidebar-inner'&&$(this).parent().attr('id')!='portfolio-extra'
&& !$(this).find('.carousel-wrap[data-full-width="true"]').length > 0
&& !$(this).find('.portfolio-items:not(".carousel")[data-col-num="elastic"]').length > 0){
if($('.single-product').length > 0&&$(this).parents('#tab-description').length > 0&&$(this).parents('.full-width-tabs').length==0){
$(this).css({
'visibility': 'visible'
});
}else{
if($(this).hasClass('portfolio-items')){
$(this).css({
'transform': 'translateX(-'+ $justOutOfSight + 'px)',
'margin-left': 0,
'width': $carouselWidth,
'visibility': 'visible'
});
}else{
$(this).css({
'margin-left': - $justOutOfSight,
'width': $carouselWidth,
'visibility': 'visible'
});
}}
}else if($(this).parent().attr('id')=='portfolio-extra'&&$('#full_width_portfolio').length!=0){
$(this).css({
'margin-left': - $justOutOfSight,
'width': $carouselWidth,
'visibility': 'visible'
});
}else{
$(this).css({
'margin-left': 0,
'visibility': 'visible'
});
}});
}
var $contentElementsNum=($('#portfolio-extra').length==0) ? $('.main-content > .row > *').length:$('.main-content > .row #portfolio-extra > *').length ;
function parallaxSrollSpeed(speedString){
var ua=window.navigator.userAgent;
var msie=ua.indexOf("MSIE ");
var speed;
if(msie > 0||!!navigator.userAgent.match(/Trident.*rv\:11\./)||$smoothCache==true||navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1){
switch(speedString){
case 'slow':
speed=0.2;
break;
case 'medium':
speed=0.4;
break;
case 'fast':
speed=0.6;
break;
}}else{
switch(speedString){
case 'slow':
speed=0.6;
break;
case 'medium':
speed=0.4;
break;
case 'fast':
speed=0.25;
break;
}}
return speed;
}
function parallaxScrollInit(){
parallaxRowsBGCals();
$('.full-width-section.parallax_section, .full-width-content.parallax_section').each(function(){
var $id=$(this).attr('id');
var ua=window.navigator.userAgent;
var msie=ua.indexOf("MSIE ");
if(msie > 0||!!navigator.userAgent.match(/Trident.*rv\:11\./)||$smoothCache==true||navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1){
if($(this).find('[data-parallax-speed="fixed"]').length==0) $('#'+$id + ".parallax_section").parallaxScroll("50%", parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed')));
}else if($(this).find('[data-parallax-speed="fixed"]').length==0){
$('#'+$id + ".parallax_section").parallaxScroll("50%", parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed')));
}});
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)){
parallaxScrollInit();
$(window).load(parallaxRowsBGCals);
}
function parallaxRowsBGCals(){
$('.full-width-section.parallax_section, .full-width-content.parallax_section').each(function(){
var ua=window.navigator.userAgent;
var msie=ua.indexOf("MSIE ");
if(msie > 0||!!navigator.userAgent.match(/Trident.*rv\:11\./)||$smoothCache==true||navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1){
$(this).find('.row-bg').css({'height': $(this).outerHeight(true)*2.8, 'margin-top': '-' + ($(this).outerHeight(true)*2.8)/2 + 'px' });
}else{
$(this).find('.row-bg').css({'height': Math.ceil($(window).height() * parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed'))) + $(this).outerHeight(true) });
}});
}
function fwsClasses(){
$('.wpb_wrapper > .nectar-slider-wrap[data-full-width="true"]').each(function(){
if(!$(this).parent().hasClass('span_9')&&!$(this).parent().hasClass('span_3')&&$(this).parent().attr('id')!='sidebar-inner'){
if($(this).parents('.wpb_row').index()=='0'){
$(this).addClass('first-nectar-slider');
}}
});
if($('#portfolio-extra').length==0){
$contentElementsNum=($('.main-content > .row > .wpb_row').length > 0) ? $('.main-content > .row > .wpb_row').length:$('.main-content > .row > *').length;
}else{
$contentElementsNum=$('.main-content > .row #portfolio-extra > *').length;
}
$('.full-width-section, .full-width-content:not(.page-submenu .full-width-content), .row > .nectar-slider-wrap[data-full-width="true"], .wpb_wrapper > .nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer, .portfolio-items[data-col-num="elastic"]').each(function(){
if(!$(this).parent().hasClass('span_9')&&!$(this).parent().hasClass('span_3')&&$(this).parent().attr('id')!='sidebar-inner'){
if($(this).parents('.wpb_row').length > 0){
if($(this).parents('#portfolio-extra').length > 0&&$('#full_width_portfolio').length==0) return false;
if($(this).parents('.wpb_row').index()=='0'&&$('#page-header-bg').length!=0||$(this).parents('.wpb_row').index()=='0'&&$('.parallax_slider_outer').length!=0){
}
else if($(this).parents('.wpb_row').index()=='0'&&$('#page-header-bg').length==0&&$('.page-header-no-bg').length==0
&& $('.project-title').length==0&&$(this).parents('.wpb_row').index()=='0'
&& $('.parallax_slider_outer').length==0&&$('.project-title').length==0
&& $('body[data-bg-header="true"]').length==0){
if($('body[data-header-resize="0"]').length==1&&$('.single').length==0){
$('.container-wrap').css('padding-top','0px');
}else{
$(this).css('margin-top','-70px').addClass('first-section');
}}
if($(this).parents('.wpb_row').index()==$contentElementsNum-1&&$('#respond').length==0){
if($(this).attr('id')!='portfolio-filters-inline'){
$('.container-wrap').css('padding-bottom','0px');
$('#call-to-action .triangle').remove();
}}
}else{
if($(this).parents('#portfolio-extra').length > 0&&$('#full_width_portfolio').length==0) return false;
if($(this).find('.portfolio-filters-inline').length==0&&$(this).attr('id')!='post-area'){
if($(this).index()=='0'&&$('#page-header-bg').length!=0||$(this).index()=='0'&&$('.parallax_slider_outer').length!=0){
}
else if($(this).index()=='0'&&$('#page-header-bg').length==0&&$(this).index()=='0'&&$('.page-header-no-bg').length==0 &&
$(this).index()=='0'&&$('.parallax_slider_outer').length==0&&!$(this).hasClass('blog_next_prev_buttons')){
if($('body[data-header-resize="0"]').length==1&&$('.single').length==0){
$('.container-wrap').css('padding-top','0px');
}else{
$(this).css('margin-top','-70px').addClass('first-section');
}}
if($(this).index()==$contentElementsNum-1&&$('#respond').length==0){
$('.container-wrap').css('padding-bottom','0px');
$('.bottom_controls').css('margin-top','0px');
$('#call-to-action .triangle').remove();
}}
}}
});
$('.full-width-section.wpb_row, .full-width-content.wpb_row').each(function(){
if(!$(this).parent().hasClass('span_9')&&!$(this).parent().hasClass('span_3')&&$(this).parent().attr('id')!='sidebar-inner'){
if($(this).parents('#portfolio-extra').length > 0&&$('#full_width_portfolio').length==0) return false;
if($(this).index()=='0'&&$('#page-header-bg').length==0&&$('.page-header-no-bg').length==0
&& $('.project-title').length==0&&$('body.single').length==0
&& $('.parallax_slider_outer').length==0&&$('.project-title').length==0){
$(this).addClass('first-section');
var $that=$(this);
setTimeout(function(){ $that.addClass('loaded'); },50);
}}
});
$('#portfolio-extra > .nectar-slider-wrap[data-full-width="true"], .portfolio-wrap').each(function(){
if($(this).index()==$contentElementsNum-1&&$('#commentform').length==0&&$('#pagination').length==0){
$(this).css('margin-bottom','-40px');
$('#call-to-action .triangle').remove();
}});
$('.portfolio-filters').each(function(){
if($(this).index()=='0'&&$('#page-header-bg').length!=0||$(this).index()=='0'&&$('.parallax_slider_outer').length!=0){
$(this).css({'margin-top':'-2.1em'}).addClass('first-section nder-page-header');
}else if($(this).index()=='0'&&$('#page-header-bg').length==0||$(this).index()=='0'&&$('.parallax_slider_outer').length==0){
$(this).css({'margin-top':'0px'}).addClass('first-section');
}});
$('.portfolio-filters-inline').each(function(){
if($(this).parents('.wpb_row').length > 0){
if($(this).parents('.wpb_row').index()=='0'&&$('#page-header-bg').length!=0||$(this).parents('.wpb_row').index()=='0'&&$('.parallax_slider_outer').length!=0){
if($('body[data-header-resize="0"]').length==0) $(this).css({'margin-top':'-2.1em', 'padding-top':'19px'}).addClass('first-section nder-page-header');
}else if($(this).parents('.wpb_row').index()=='0'&&$('#page-header-bg').length==0||$(this).parents('.wpb_row').index()=='0'&&$('.parallax_slider_outer').length==0){
if($('body[data-header-resize="0"]').length==1){
}else{
$(this).css({'margin-top':'-70px', 'padding-top':'50px'}).addClass('first-section');
}}
}else{
if($(this).index()=='0'&&$('#page-header-bg').length!=0||$(this).index()=='0'&&$('.parallax_slider_outer').length!=0){
$(this).css({'margin-top':'-2.1em', 'padding-top':'19px'}).addClass('first-section nder-page-header');
}else if($(this).index()=='0'&&$('#page-header-bg').length==0||$(this).index()=='0'&&$('.parallax_slider_outer').length==0){
if($('body[data-header-resize="0"]').length==1){
$(this).css({'margin-top':'-30px', 'padding-top':'50px'}).addClass('first-section');
}else{
$(this).css({'margin-top':'-70px', 'padding-top':'50px'}).addClass('first-section');
}}
}});
$('.parallax_slider_outer').each(function(){
if(!$(this).parent().hasClass('span_9')&&!$(this).parent().hasClass('span_3')&&$(this).parent().attr('id')!='sidebar-inner'){
if($(this).parents('#portfolio-extra').length > 0&&$('#full_width_portfolio').length==0) return false;
if($(this).parent().index()=='0'&&$('#page-header-bg').length!=0){
$(this).addClass('first-section nder-page-header');
}
else if($(this).parent().index()=='0'&&$('#page-header-bg').length==0){
$(this).css('margin-top','-40px').addClass('first-section');
if(!$('body').hasClass('single-post')) $('.container-wrap').css('padding-top', '0px');
}
if($(this).parent().index()==$contentElementsNum-1&&$('#post-area').length==0){
$('#call-to-action .triangle').remove();
$('.container-wrap').hide();
}}
});
}
fullWidthSections();
fwsClasses();
function fullwidthImgOnlySizingInit(){
$('.full-width-section:not(.custom-skip)').each(function(){
var $fwsHeight=$(this).outerHeight(true);
if($(this).find('.span_12 *').length==0&&$.trim($(this).find('.span_12').text()).length==0&&$fwsHeight > 40){
$(this).addClass('bg-only');
$(this).css({'height': $fwsHeight, 'padding-top': '0px', 'padding-bottom': '0px'});
$(this).attr('data-image-height',$fwsHeight);
}});
}
function fullwidthImgOnlySizing(){
$('.full-width-section.bg-only').each(function(){
var $initialHeight=$(this).attr('data-image-height');
if(window.innerWidth < 1000&&window.innerWidth > 690){
$(this).css('height', $initialHeight - $initialHeight*.60);
}
else if(window.innerWidth <=690){
$(this).css('height', $initialHeight - $initialHeight*.78);
}
else if(window.innerWidth < 1300&&window.innerWidth >=1000){
$(this).css('height', $initialHeight - $initialHeight*.33);
}else{
$(this).css('height', $initialHeight);
}});
}
fullwidthImgOnlySizingInit();
fullwidthImgOnlySizing();
function fullWidthRowPaddingAdjustInit(){
if($('#boxed').length==0){
$('.full-width-section, .full-width-content').each(function(){
var $topPadding=$(this)[0].style.paddingTop;
var $bottomPadding=$(this)[0].style.paddingBottom;
if($topPadding.indexOf("%") >=0) $(this).attr('data-top-percent',$topPadding);
if($bottomPadding.indexOf("%") >=0) $(this).attr('data-bottom-percent',$bottomPadding);
});
}}
function fullWidthRowPaddingAdjustCalc(){
if($('#boxed').length==0){
$('.full-width-section[data-top-percent], .full-width-section[data-bottom-percent], .full-width-content[data-top-percent], .full-width-content[data-bottom-percent]').each(function(){
var $windowHeight=$(window).width();
var $topPadding=($(this).attr('data-top-percent')) ? $(this).attr('data-top-percent'):'skip';
var $bottomPadding=($(this).attr('data-bottom-percent')) ? $(this).attr('data-bottom-percent'):'skip';
if($topPadding!='skip'){
$(this).css('padding-top',$windowHeight*(parseInt($topPadding)/100));
}
if($bottomPadding!='skip'){
$(this).css('padding-bottom',$windowHeight*(parseInt($bottomPadding)/100));
}});
}}
fullWidthRowPaddingAdjustInit();
fullWidthRowPaddingAdjustCalc();
function fullWidthContentColumns(){
$('.main-content > .row > .full-width-content, #portfolio-extra > .full-width-content, .woocommerce-tabs #tab-description > .full-width-content, #post-area.span_12 article .content-inner > .full-width-content').each(function(){
if($(this).find('> .span_12 > .col').length > 1){
var tallestColumn=0;
var $columnInnerHeight=0;
$(this).find('> .span_12 > .col').each(function(){
$column_inner_selector=($(this).find('> .vc_column-inner > .wpb_wrapper').length > 0) ? '.vc_column-inner':'.column-inner-wrap > .column-inner';
var $padding=parseInt($(this).css('padding-top'));
($(this).find('> '+$column_inner_selector+' > .wpb_wrapper').height() + ($padding*2) > tallestColumn) ? tallestColumn=$(this).find('> '+$column_inner_selector+' > .wpb_wrapper').height() + ($padding*2):tallestColumn=tallestColumn;
});
$(this).find('> .span_12 > .col').each(function(){
$column_inner_selector=($(this).find('> .vc_column-inner > .wpb_wrapper').length > 0) ? '.vc_column-inner':'.column-inner-wrap > .column-inner';
if($(this).find('> '+$column_inner_selector+' > .wpb_wrapper > *').length > 0){
$(this).css('height',tallestColumn);
}else{
$(this).css('min-height',tallestColumn);
if($(this).is('[data-animation*="reveal"]')) $(this).find('.column-inner').css('min-height',tallestColumn);
}});
var $childRows=$(this).find('> .span_12 > .col .wpb_row').length;
if(window.innerWidth > 1000){
var $padding=parseInt($(this).find('> .span_12 > .col').css('padding-top'));
}else{
$(this).find('> .span_12 > .col .wpb_row .col').css('min-height','0px');
}
if($(this).hasClass('vertically-align-columns')&&window.innerWidth > 1000&&!$(this).hasClass('vc_row-o-equal-height')){
$(this).find('> .span_12 > .col').each(function(){
$column_inner_selector=($(this).find('> .vc_column-inner > .wpb_wrapper').length > 0) ? '.vc_column-inner':'.column-inner-wrap > .column-inner';
$columnInnerHeight=$(this).find('> '+$column_inner_selector+' > .wpb_wrapper').height();
var $marginCalc=($(this).height()/2)-($columnInnerHeight/2);
if($marginCalc <=0) $marginCalc=0;
$(this).find('> '+$column_inner_selector+' > .wpb_wrapper').css('margin-top',$marginCalc);
$(this).find('> '+$column_inner_selector+' > .wpb_wrapper').css('margin-bottom',$marginCalc);
});
}}
});
$('.main-content > .row > .wpb_row:not(.full-width-content).vc_row-o-equal-height').each(function(){
if($(this).find('>.span_12>.wpb_column[data-animation*="reveal"]').length >0){
var tallestColumn=0;
var $columnInnerHeight=0;
$(this).find('> .span_12 > .col').each(function(){
var $padding=parseInt($(this).find('> .column-inner-wrap > .column-inner').css('padding-top'));
($(this).find('> .column-inner-wrap > .column-inner').height() + ($padding*2) > tallestColumn) ? tallestColumn=$(this).find('> .column-inner-wrap > .column-inner').height() + ($padding*2):tallestColumn=tallestColumn;
});
$(this).find('> .span_12 > .col').each(function(){
if($(this).find('> .column-inner-wrap > .column-inner .wpb_wrapper > *').length > 0){
$(this).find('> .column-inner-wrap').css('height',tallestColumn);
}else{
$(this).css('min-height',tallestColumn);
if($(this).is('[data-animation*="reveal"]')) $(this).find('.column-inner').css('min-height',tallestColumn);
}});
}});
$('.vc_row.vc_row-o-equal-height>.span_12>.wpb_column[class*="padding-"][data-padding-pos="all"]').each(function(){
$(this).css({ 'padding-top': $(this).css('padding-left'), 'padding-bottom': $(this).css('padding-left')});
});
}
fullWidthContentColumns();
if($('.owl-carousel').length > 0) owlCarouselInit();
var $mouseParallaxScenes=[];
function mouseParallaxInit(){
$('.wpb_row:has(.nectar-parallax-scene)').each(function(i){
if($(this).hasClass('first-section')){
$('body #header-outer[data-transparent-header="true"] .ns-loading-cover').show();
if($('body #header-outer[data-transparent-header="true"]').length > 0){
$(this).css('overflow','hidden');
$(this).find('.nectar-slider-loading').css({
'top': $('#header-space').height(),
'margin-top':'-1px'
});
$(this).find('.nectar-slider-loading .loading-icon').css({
'height':$('.first-section .nectar-parallax-scene').height() - $('#header-space').height() + 'px',
'opacity':'1'
});
}}
var $strength=parseInt($(this).find('.nectar-parallax-scene').attr('data-scene-strength'));
$mouseParallaxScenes[i]=$(this).find('.nectar-parallax-scene').parallax({
scalarX: $strength,
scalarY: $strength
});
var images=$(this).find('.nectar-parallax-scene li');
$.each(images, function(){
if($(this).find('div').length > 0){
var el=$(this).find('div'),
image=el.css('background-image').replace(/"/g, '').replace(/url\(|\)$/ig, '');
if(image&&image!==''&&image!=='none')
images=images.add($('
').attr('src', image));
}});
var $that=$(this);
images.imagesLoaded(function(){
$that.find('> .nectar-slider-loading, .full-page-inner > .nectar-slider-loading').fadeOut(800,'easeInOutExpo');
if($that.hasClass('first-section')){
$('body #header-outer[data-transparent-header="true"] .ns-loading-cover').fadeOut(800,'easeInOutExpo',function(){
$(this).remove();
});
}});
});
}
mouseParallaxInit();
function ulChecks(){
$('ul.checks li').prepend('
');
}
ulChecks();
function colAndImgAnimations(){
$colAndImgOffsetPos=($('#nectar_fullscreen_rows').length > 0) ? '200%':'85%';
$colAndImgOffsetPos2=($('#nectar_fullscreen_rows').length > 0) ? '200%':'70%';
$($fullscreenSelector+'img.img-with-animation').each(function(){
var $that=$(this);
var $animationEasing=($('body[data-cae]').length > 0) ? $('body').attr('data-cae'):'easeOutSine';
var $animationDuration=($('body[data-cad]').length > 0) ? $('body').attr('data-cad'):'650';
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)||$('body[data-responsive="0"]').length > 0){
if($that.attr('data-animation')=='fade-in-from-left'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1,
'x':'0px'
},$animationDuration, $animationEasing);
}else if($that.attr('data-animation')=='fade-in-from-right'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1,
'x':'0px'
},$animationDuration, $animationEasing);
}else if($that.attr('data-animation')=='fade-in-from-bottom'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1,
'y':'0px'
},$animationDuration, $animationEasing);
}else if($that.attr('data-animation')=='fade-in'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1
},$animationDuration, $animationEasing);
}else if($that.attr('data-animation')=='grow-in'){
setTimeout(function(){
$that.transition({ scale: 1, 'opacity':1 },$animationDuration,$animationEasing);
},$that.attr('data-delay'));
}
else if($that.attr('data-animation')=='flip-in'){
setTimeout(function(){
$that.transition({ rotateY: 0, 'opacity':1 },$animationDuration, $animationEasing);
},$that.attr('data-delay'));
}
$that.addClass('animated-in');
}
waypoint.destroy();
},
offset: $colAndImgOffsetPos
});
});
$($fullscreenSelector+'.nectar_cascading_images').each(function(){
var $that=$(this);
var $animationEasing=($('body[data-cae]').length > 0) ? $('body').attr('data-cae'):'easeOutSine';
var $animationDuration=($('body[data-cad]').length > 0) ? $('body').attr('data-cad'):'650';
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)||$('body[data-responsive="0"]').length > 0){
$that.find('.cascading-image').each(function(i){
var $that2=$(this);
if($that2.attr('data-animation')=='flip-in'){
setTimeout(function(){
$that2.find('.inner-wrap').css({
'opacity':1,
'transform':'rotate(0deg) translateZ(0px)'
});
}, i*175);
}else{
setTimeout(function(){
$that2.find('.inner-wrap').css({
'opacity':1,
'transform':'translateX(0px) translateY(0px) scale(1,1) translateZ(0px)'
});
}, i*175);
}});
$that.addClass('animated-in');
}
waypoint.destroy();
},
offset: $colAndImgOffsetPos
});
});
$($fullscreenSelector+'.col.has-animation:not([data-animation*="reveal"]), '+$fullscreenSelector+'.wpb_column.has-animation:not([data-animation*="reveal"])').each(function(){
var $that=$(this);
var $animationEasing=($('body[data-cae]').length > 0) ? $('body').attr('data-cae'):'easeOutSine';
var $animationDuration=($('body[data-cad]').length > 0) ? $('body').attr('data-cad'):'650';
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)||$('body[data-responsive="0"]').length > 0){
if($that.attr('data-animation')=='fade-in-from-left'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1,
'x':'0px'
},$animationDuration,$animationEasing);
}else if($that.attr('data-animation')=='fade-in-from-right'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1,
'x':'0px'
},$animationDuration,$animationEasing);
}else if($that.attr('data-animation')=='fade-in-from-bottom'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1,
'y':'0px'
},$animationDuration,$animationEasing);
}else if($that.attr('data-animation')=='fade-in'){
$that.delay($that.attr('data-delay')).transition({
'opacity':1
},$animationDuration,$animationEasing);
}else if($that.attr('data-animation')=='grow-in'){
setTimeout(function(){
$that.transition({ scale: 1, 'opacity':1 },$animationDuration,$animationEasing);
},$that.attr('data-delay'));
}else if($that.attr('data-animation')=='flip-in'){
setTimeout(function(){
$that.transition({ rotateY: 0, 'opacity':1 },$animationDuration, $animationEasing);
},$that.attr('data-delay'));
}
if($that.hasClass('boxed')){
$that.addClass('no-pointer-events');
setTimeout(function(){
$that.removeClass('no-pointer-events');
},parseInt($animationDuration) + parseInt($that.attr('data-delay')) + 30);
}
$that.addClass('animated-in');
}
waypoint.destroy();
},
offset: $colAndImgOffsetPos
});
});
$($fullscreenSelector+'.wpb_column.has-animation[data-animation*="reveal"]').each(function(){
var $that=$(this);
var $animationEasing=($('body[data-cae]').length > 0) ? $('body').attr('data-cae'):'easeOutSine';
var $animationDuration=($('body[data-cad]').length > 0) ? $('body').attr('data-cad'):'650';
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)||$('body[data-responsive="0"]').length > 0){
if($that.attr('data-animation')=='reveal-from-bottom'||$that.attr('data-animation')=='reveal-from-top'){
setTimeout(function(){
if($that.hasClass('animated-in')) $that.find('.column-inner-wrap, .column-inner').transition({ 'y': 0 },$animationDuration, $animationEasing,function(){ if($that.hasClass('animated-in')) $that.find('.column-inner-wrap, .column-inner').addClass('no-transform'); });
},$that.attr('data-delay'));
}else if($that.attr('data-animation')=='reveal-from-right'||$that.attr('data-animation')=='reveal-from-left'){
setTimeout(function(){
if($that.hasClass('animated-in')) $that.find('.column-inner-wrap, .column-inner').transition({ 'x': 0 },$animationDuration, $animationEasing,function(){ if($that.hasClass('animated-in')) $that.find('.column-inner-wrap, .column-inner').addClass('no-transform'); });
},$that.attr('data-delay'));
}
$that.addClass('animated-in');
}
waypoint.destroy();
},
offset: $colAndImgOffsetPos2
});
});
}
setTimeout(function(){
},$animationOnScrollTimeOut);
function cascadingImageBGSizing(){
$('.nectar_cascading_images').each(function(){
if($(this).parents('.vc_row-o-equal-height').length > 0&&$(this).parents('.wpb_column').length > 0)
$(this).css('max-width',$(this).parents('.wpb_column').width());
$(this).find('.bg-color').each(function(){
var $bgColorHeight=0;
var $bgColorWidth=0;
if($(this).parent().find('.img-wrap').length==0){
$firstSibling=$(this).parents('.cascading-image').siblings('.cascading-image[data-has-img="true"]').first();
$firstSibling.css({'position':'relative', 'visiblity':'hidden'});
$bgColorHeight=$firstSibling.find('.img-wrap').height();
$bgColorWidth=$firstSibling.find('.img-wrap').width();
if($firstSibling.index()==0){
$firstSibling.css({'visiblity':'visible'});
}else{
$firstSibling.css({'position':'absolute', 'visiblity':'visible'});
}}else{
$bgColorHeight=$(this).parent().find('.img-wrap').height();
$bgColorWidth=$(this).parent().find('.img-wrap').width();
}
$(this).css({'height': $bgColorHeight,'width': $bgColorWidth});
});
});
}
imagesLoaded($('.nectar_cascading_images'),function(instance){
cascadingImageBGSizing();
});
function splitLineHeadings(){
$splitLineOffsetPos=($('#nectar_fullscreen_rows').length > 0) ? '100%':'bottom-in-view';
$($fullscreenSelector+'.nectar-split-heading').each(function(){
var $that=$(this);
var $animationEasing=($('body[data-cae]').length > 0) ? $('body').attr('data-cae'):'easeOutSine';
var $animationDuration=($('body[data-cad]').length > 0) ? $('body').attr('data-cad'):'650';
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)||$('body[data-responsive="0"]').length > 0){
$that.find('.heading-line').each(function(i){
$(this).find('> span').delay(i*70).transition({
'y':'0px'
},$animationDuration,$animationEasing);
});
$that.addClass('animated-in');
}
waypoint.destroy();
},
offset: $splitLineOffsetPos
});
});
}
function oneFourthClasses(){
$('.col.span_3, .vc_span3, .vc_col-sm-3').each(function(){
var $currentDiv=$(this);
var $nextDiv=$(this).next('div');
if($nextDiv.hasClass('span_3')&&!$currentDiv.hasClass('one-fourths')||$nextDiv.hasClass('vc_span3')&&!$currentDiv.hasClass('one-fourths')||$nextDiv.hasClass('vc_col-sm-3')&&!$currentDiv.hasClass('one-fourths')){
$currentDiv.addClass('one-fourths clear-both');
$nextDiv.addClass('one-fourths right-edge');
}});
/*$('.vc_span4').each(function(){
if($(this).find('.team-member').length > 0&&$(this).parents('.full-width-content').length > 0){
var $currentDiv=$(this);
var $nextDiv=$(this).next('div');
if(!$currentDiv.hasClass('one-fourths')){
$currentDiv.addClass('one-fourths clear-both');
$nextDiv.addClass('one-fourths right-edge');
}}
});*/
$('.span_12 .col.span_6').each(function(){
if($(this).next('div').hasClass('span_6')&&$.trim($(this).next('div').html()).length==0){
$(this).addClass('empty-second')
}});
}
oneFourthClasses();
function progressBars(){
$progressBarsOffsetPos=($('#nectar_fullscreen_rows').length > 0) ? '100%':'bottom-in-view';
$($fullscreenSelector+'.nectar-progress-bar').parent().each(function(i){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('completed')){
waypoint.destroy();
return;
}
if($progressBarsOffsetPos=='100%') $that.find('.nectar-progress-bar .bar-wrap').css('opacity','1');
$that.find('.nectar-progress-bar').each(function(i){
var percent=$(this).find('span').attr('data-width');
var $endNum=parseInt($(this).find('span strong i').text());
var $that=$(this);
$that.find('span').delay(i*90).transition({
'width':percent + '%'
},1050, 'easeInOutQuint',function(){
});
setTimeout(function(){
$that.find('span strong i').countTo({
from: 0,
to: $endNum,
speed: 850,
refreshInterval: 30,
onComplete: function(){
}});
$that.find('span strong').transition({
'opacity':1
},550, 'easeInCirc');
}, (i*90));
if(percent=='100'){
$that.find('span strong').addClass('full');
}});
$that.addClass('completed');
waypoint.destroy();
},
offset: $progressBarsOffsetPos
});
});
}
function dividers(){
$dividerOffsetPos=($('#nectar_fullscreen_rows').length > 0) ? '100%':'bottom-in-view';
$($fullscreenSelector+'.divider-small-border[data-animate="yes"], '+$fullscreenSelector+'.divider-border[data-animate="yes"]').each(function(i){
var $lineDur=($(this).hasClass('divider-small-border')) ? 1300:1500;
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('completed')){
waypoint.destroy();
return;
}
$that.each(function(i){
$(this).css({'transform':'scale(0,1)', 'visibility': 'visible'});
var $that=$(this);
$that.delay($that.attr('data-animation-delay')).transition({
'transform':'scale(1, 1)'
},$lineDur, 'cubic-bezier(.18,1,.22,1)');
});
$that.addClass('completed');
waypoint.destroy();
},
offset: $dividerOffsetPos
});
});
}
function iconList(){
$iconListOffsetPos=($('#nectar_fullscreen_rows').length > 0) ? '100%':'bottom-in-view';
$($fullscreenSelector+'.nectar-icon-list[data-animate="true"]').each(function(i){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('completed')){
waypoint.destroy();
return;
}
$that.each(function(i){
$(this).find('.nectar-icon-list-item').each(function(i){
var $thatt=$(this);
setTimeout(function(){ $thatt.addClass('animated') },i*300);
});
});
$that.addClass('completed');
waypoint.destroy();
},
offset: $iconListOffsetPos
});
});
}
$('.nectar-icon-list[data-icon-style="border"]').each(function(){
if($(this).parents('.wpb_row').length > 0&&$(this).parents('.wpb_row').find('.row-bg.using-bg-color').length > 0){
var $bgColorToSet=$(this).parents('.wpb_row').find('.row-bg.using-bg-color').css('background-color');
}else{
if($('#nectar_fullscreen_rows').length > 0)
var $bgColorToSet=$('#nectar_fullscreen_rows > .wpb_row .full-page-inner-wrap').css('background-color');
else
var $bgColorToSet=$('.container-wrap').css('background-color');
}
$(this).find('.list-icon-holder').css('background-color',$bgColorToSet);
});
$('.nectar_image_with_hotspots[data-hotspot-icon="numerical"]').each(function(){
$(this).find('.nectar_hotspot_wrap').each(function(i){
var $that=$(this);
setTimeout(function(){
$that.find('.nectar_hotspot').addClass('pulse');
},i*300);
});
});
function hotSpotHoverBind(){
var hotSpotHoverTimeout=[];
$('.nectar_hotspot').each(function(i){
hotSpotHoverTimeout[i]='';
$(this).on('mouseover', function(){
clearTimeout(hotSpotHoverTimeout[i]);
$(this).parent().css({'z-index':'10', 'height':'auto','width':'auto'});
});
$(this).on('mouseleave', function(){
var $that=$(this);
$that.parent().css({'z-index':'auto'});
hotSpotHoverTimeout[i]=setTimeout(function(){
$that.parent().css({'height':'30px','width':'30px'});
},300);
});
});
}
hotSpotHoverBind();
function responsiveTooltips(){
$('.nectar_image_with_hotspots').each(function(){
$(this).find('.nectar_hotspot_wrap').each(function(i){
if($(window).width() > 690){
if($(this).parents('.nectar_image_with_hotspots[data-tooltip-func="hover"]').length > 0){
$(this).find('.nectar_hotspot').removeClass('click');
$(this).find('.nttip').removeClass('open');
}
$(this).find('.nttip .inner a.tipclose').remove();
$('.nttip').css('height','auto');
$(this).css({'width': 'auto','height': 'auto'});
$(this).find('.nttip').removeClass('force-right').removeClass('force-left').removeClass('force-top').css('width','auto');
var $tipOffset=$(this).find('.nttip').offset();
if($tipOffset.left > $(this).parents('.nectar_image_with_hotspots').width() - 200)
$(this).find('.nttip').css('width','250px');
else
$(this).find('.nttip').css('width','auto');
if($tipOffset.left < 0)
$(this).find('.nttip').addClass('force-right');
else if($tipOffset.left + $(this).find('.nttip').outerWidth(true) > $(window).width())
$(this).find('.nttip').addClass('force-left').css('width','250px');
else if($tipOffset.top + $(this).find('.nttip').height() + 35 > $(window).height())
$(this).find('.nttip').addClass('force-top');
$(this).css({'width': '30px','height': '30px'});
}else{
$(this).find('.nttip').removeClass('force-left').removeClass('force-right').removeClass('force-top');
$(this).find('.nectar_hotspot').addClass('click');
if($(this).find('.nttip a.tipclose').length==0)
$(this).find('.nttip .inner').append('
');
$('.nttip').css('height',$(window).height());
}});
});
}
responsiveTooltips();
function imageWithHotspotClickEvents(){
$('body').on('click','.nectar_hotspot.click',function(){
$(this).parents('.nectar_image_with_hotspots').find('.nttip').removeClass('open');
$(this).parent().find('.nttip').addClass('open');
$(this).parents('.nectar_image_with_hotspots').find('.nectar_hotspot').removeClass('open');
$(this).parent().find('.nectar_hotspot').addClass('open');
if($(window).width() <=690) $(this).parents('.wpb_row, [class*="vc_col-"]').css('z-index','200');
return false;
});
$('body').on('click','.nectar_hotspot.open',function(){
$(this).parent().find('.nttip').removeClass('open');
$(this).parent().find('.nectar_hotspot').removeClass('open');
$(this).parents('.wpb_row').css('z-index','auto');
return false;
});
$('body').on('click','.nttip.open',function(){
$(this).parents('.nectar_image_with_hotspots').find('.nttip').removeClass('open');
$(this).parents('.wpb_row').css('z-index','auto');
return false;
});
}
imageWithHotspotClickEvents();
function imageWithHotspots(){
$imageWithHotspotsOffsetPos=($('#nectar_fullscreen_rows').length > 0) ? '100%':'50%';
$($fullscreenSelector+'.nectar_image_with_hotspots[data-animation="true"]').each(function(i){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('completed')){
waypoint.destroy();
return;
}
$that.addClass('completed');
$that.find('.nectar_hotspot_wrap').each(function(i){
var $that2=$(this);
var $extrai=($that2.parents('.col.has-animation').length > 0) ? 1:0;
setTimeout(function(){
$that2.addClass('animated-in');
},175*(i+$extrai));
});
waypoint.destroy();
},
offset: $imageWithHotspotsOffsetPos
});
});
}
function animated_titles(){
$animatedTitlesOffsetPos=($('#nectar_fullscreen_rows').length > 0) ? '100%':'bottom-in-view';
$($fullscreenSelector+'.nectar-animated-title').each(function(i){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('completed')){
waypoint.destroy();
return;
}
$that.addClass('completed');
waypoint.destroy();
},
offset: $animatedTitlesOffsetPos
});
});
}
var $tallestCol;
function pricingTableHeight(){
$('.pricing-table[data-style="default"]').each(function(){
$tallestCol=0;
$(this).find('> div ul').each(function(){
($(this).height() > $tallestCol) ? $tallestCol=$(this).height():$tallestCol=$tallestCol;
});
if($tallestCol==0) $tallestCol='auto';
$(this).find('> div ul').css('height',$tallestCol);
});
}
pricingTableHeight();
$('body').on('click','.testimonial_slider:not([data-style="multiple_visible"]) .controls li', function(){
if($(this).find('span').hasClass('active')) return false;
var $index=$(this).index();
var currentHeight=$(this).parents('.testimonial_slider').find('.slides blockquote').eq($index).height();
$(this).parents('.testimonial_slider').find('li span').removeClass('active');
$(this).find('span').addClass('active');
$(this).parents('.testimonial_slider').find('.slides blockquote').stop().css({'opacity':'0', 'left':'-25px', 'z-index': '1'});
$(this).parents('.testimonial_slider').find('.slides blockquote').eq($index).stop(true,true).animate({'opacity':'1','left':'0'},550,'easeOutCubic').css('z-index','20');
$(this).parents('.testimonial_slider:not(.disable-height-animation)').find('.slides').stop(true,true).animate({'height':currentHeight + 40 + 'px' },450,'easeOutCubic');
resizeVideoToCover();
});
var $tallestQuote;
function createTestimonialControls(){
$('.testimonial_slider:not([data-style="multiple_visible"])').animate({'opacity':'1'},800);
$('.testimonial_slider:not([data-style="multiple_visible"])').each(function(){
if($(this).find('blockquote').length > 1&&$(this).find('.controls').length==0){
$(this).append('
');
var slideNum=$(this).find('blockquote').length;
var $that=$(this);
for(var i=0;i
')
}
$(this).find('.controls ul li').first().click();
if($(this).attr('data-autorotate').length > 0){
slide_interval=(parseInt($(this).attr('data-autorotate')) < 100) ? 4000:parseInt($(this).attr('data-autorotate'));
var $that=$(this);
var $rotate=setInterval(function(){ testimonialRotate($that) },slide_interval);
}
$(this).find('.controls li').click(function(e){
if(typeof e.clientX!='undefined') clearInterval($rotate);
});
$(this).swipe({
swipeLeft:function(e){
$(this).find('.controls ul li span.active').parent().next('li').find('span').trigger('click');
e.stopImmediatePropagation();
clearInterval($rotate);
return false;
},
swipeRight:function(e){
$(this).find('.controls ul li span.active').parent().prev('li').find('span').trigger('click');
e.stopImmediatePropagation();
clearInterval($rotate);
return false;
}});
}
else if($(this).find('.controls').length==0){
var currentHeight=$(this).find('.slides blockquote').height();
$(this).find('.slides blockquote').stop().css({'opacity':'0', 'left':'-25px', 'z-index': '1'});
$(this).find('.slides blockquote').stop(true,true).transition({'opacity':'1','left':'0'},550,'easeOutCubic').css('z-index','20');
$(this).find('.slides').stop(true,true).animate({'height':currentHeight + 20 + 'px' },450,'easeOutCubic');
}});
$('.testimonial_slider[data-style="multiple_visible"] .slides').each(function(){
var $that=$(this);
var $element=$that;
var $autoplay=($that.parents('.testimonial_slider').attr('data-autorotate').length > 1&&parseInt($that.parents('.testimonial_slider').attr('data-autorotate')) > 100) ? parseInt($that.parents('.testimonial_slider').attr('data-autorotate')):4000;
if($that.find('img').length==0) $element=$('body');
$(this).find('blockquote').each(function(){
$(this).find('.image-icon').insertAfter($(this).find('p'));
});
imagesLoaded($element,function(instance){
$that.flickity({
contain: true,
draggable: true,
lazyLoad: false,
imagesLoaded: true,
percentPosition: true,
prevNextButtons: false,
pageDots: true,
resize: true,
setGallerySize: true,
wrapAround: true,
autoPlay: $autoplay,
accessibility: false
});
$that.parents('.testimonial_slider').css('opacity','1');
});
});
}
createTestimonialControls();
function testimonialRotate(slider){
var $testimonialLength=slider.find('li').length;
var $currentTestimonial=slider.find('.pagination-switch.active').parent().index();
if(slider.parents('.toggle').length > 0&&slider.parents('.toggle').hasClass('open')){
if($currentTestimonial+1==$testimonialLength){
slider.find('ul li:first-child').click();
}else{
slider.find('.pagination-switch.active').parent().next('li').click();
}}else{
if($currentTestimonial+1==$testimonialLength){
slider.find('ul li:first-child').click();
}else{
slider.find('.pagination-switch.active').parent().next('li').click();
}}
}
function testimonialHeightResize(){
$('.testimonial_slider:not(.disable-height-animation):not([data-style="multiple_visible"])').each(function(){
var $index=$(this).find('.controls ul li span.active').parent().index();
var currentHeight=$(this).find('.slides blockquote').eq($index).height();
$(this).find('.slides').stop(true,true).css({'height':currentHeight + 40 + 'px' });
});
}
function testimonialSliderHeight(){
$('.testimonial_slider.disable-height-animation:not([data-style="multiple_visible"])').each(function(){
$tallestQuote=0;
$(this).find('blockquote').each(function(){
($(this).height() > $tallestQuote) ? $tallestQuote=$(this).height():$tallestQuote=$tallestQuote;
});
if($tallestQuote==0) $tallestQuote=100;
$(this).find('.slides').css('height',$tallestQuote+40+'px');
$(this).animate({'opacity':'1'});
fullWidthContentColumns();
});
}
testimonialSliderHeight();
function responsiveVideoIframesInit(){
$('iframe').each(function(){
if(typeof $(this).attr('src')!='undefined'&&!$(this).parent().hasClass('iframe-embed')&&$(this).parents('.ult_modal').length==0&&$(this).parents('.ls-slide').length==0&&$(this).parents('.esg-entry-media').length==0){
if($(this).attr('src').toLowerCase().indexOf("youtube") >=0||$(this).attr('src').toLowerCase().indexOf("vimeo") >=0||$(this).attr('src').toLowerCase().indexOf("twitch.tv") >=0||$(this).attr('src').toLowerCase().indexOf("kickstarter") >=0||$(this).attr('src').toLowerCase().indexOf("embed-ssl.ted") >=0||$(this).attr('src').toLowerCase().indexOf("dailymotion") >=0){
$(this).wrap('');
$(this).attr('data-aspectRatio', this.height / this.width).removeAttr('height').removeAttr('width');
if($(this).attr('src').indexOf('wmode=transparent')==-1){
if($(this).attr('src').indexOf('?')==-1){
$(this).attr('src',$(this).attr('src') + '?wmode=transparent');
}else{
$(this).attr('src',$(this).attr('src') + '&wmode=transparent');
}}
}}else{
}});
}
function responsiveVideoIframes(){
$('iframe[data-aspectRatio]').each(function(){
var newWidth=$(this).parent().width();
var $el=$(this);
if($(this).parents('.swiper-slide').length > 0){
if($(this).is(':visible')) $el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio'));
}else{
$el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio'));
}});
}
function videoshortcodeSize(){
$('.wp-video').each(function(){
$(this).attr('data-aspectRatio', parseInt($(this).find('.mejs-overlay').height()) / parseInt($(this).find('.wp-video-shortcode').css('width')));
var newWidth=$(this).width();
var $el=$(this).find('.wp-video-shortcode');
$(this).width(newWidth).height(newWidth * $(this).attr('data-aspectRatio'));
});
}
responsiveVideoIframesInit();
responsiveVideoIframes();
videoshortcodeSize();
$('.video-wrap iframe').unwrap();
$('#sidebar iframe[src]').unwrap();
$('video:not(.slider-video)').attr('width','100%');
$('video:not(.slider-video)').attr('height','100%');
$('audio').attr('width','100%');
$('audio').attr('height','100%');
$('audio').css('visibility','visible');
if($('body').hasClass('mobile')){
$('video').css('visibility','hidden');
}else{
$('video').css('visibility','visible');
}
$(window).load(function(){
$('video').css('visibility','visible');
showLateIframes();
videoshortcodeSize();
});
$('.wp-video').each(function(){
video=$(this).find('video').get(0);
video.addEventListener('loadeddata', function(){
videoshortcodeSize();
$(window).trigger('resize');
}, false);
});
$('.main-content iframe[src]').each(function(){
$(this).attr('src',$(this).attr('src'));
$(this).css({'opacity':'1', 'visibility':'visible'});
});
showLateIframes();
function showLateIframes(){
$('iframe[src]').css('opacity','1');
setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 100);
setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 500);
setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 1000);
setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 1500);
setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 2500);
}
$('.wpb_row:has(".nectar-video-wrap"):not(.fp-section)').each(function(i){
$(this).css('z-index',100 + i);
});
var min_w=1200;
var vid_w_orig;
var vid_h_orig;
vid_w_orig=1280;
vid_h_orig=720;
function resizeVideoToCover(){
$('.nectar-video-wrap').each(function(i){
if($(this).parents('#page-header-bg').length > 0){
if($('.container-wrap.auto-height').length > 0) return false;
var $containerHeight=$(this).parents('#page-header-bg').outerHeight();
var $containerWidth=$(this).parents('#page-header-bg').outerWidth();
}else{
var $containerHeight=$(this).parents('.wpb_row').outerHeight();
var $containerWidth=$(this).parents('.wpb_row').outerWidth();
}
$(this).width($containerWidth);
$(this).height($containerHeight);
var scale_h=$containerWidth / vid_w_orig;
var scale_v=($containerHeight - $containerHeight) / vid_h_orig;
var scale=scale_h > scale_v ? scale_h:scale_v;
min_w=1280/720 * ($containerHeight+40);
if(scale * vid_w_orig < min_w){scale=min_w / vid_w_orig;}
$(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * vid_w_orig +0));
$(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * vid_h_orig +0));
$(this).scrollLeft(($(this).find('video').width() - $containerWidth) / 2);
$(this).scrollTop(($(this).find('video').height() - ($containerHeight)) / 2);
$(this).find('.mejs-overlay, .mejs-poster').scrollTop(($(this).find('video').height() - ($containerHeight)) / 2);
if($(this).attr('data-bg-alignment')=='center bottom'||$(this).attr('data-bg-alignment')=='bottom'){
$(this).scrollTop(($(this).find('video').height() - ($containerHeight+6)));
}
else if($(this).attr('data-bg-alignment')=='center top'||$(this).attr('data-bg-alignment')=='top'){
$(this).scrollTop(0);
}});
}
function videoBGInit(){
setTimeout(function(){
resizeVideoToCover();
$('.video-color-overlay').each(function(){
$(this).css('background-color',$(this).attr('data-color'));
});
$('.nectar-video-wrap').each(function(i){
var $headerVideo=($(this).parents('#page-header-bg').length > 0) ? true:false;
var $that=$(this);
var videoReady=setInterval(function(){
if($that.find('video').get(0).readyState > 3){
$that.transition({'opacity':'1'},400);
$that.find('video').transition({'opacity':'1'},400);
$that.parent().find('.video-color-overlay').transition({'opacity':'0.7'},400);
if($headerVideo==true){
pageHeaderTextEffect();
}
$('#ajax-loading-screen').addClass('loaded');
setTimeout(function(){ $('#ajax-loading-screen').addClass('hidden'); },1000);
clearInterval(videoReady);
}},60);
});
},300);
if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
$('.wpb_row .mobile-video-image, #page-header-wrap .mobile-video-image, .fullscreen-header .mobile-video-image').show();
$('.nectar-video-wrap').remove();
}
if(navigator.userAgent.indexOf('Chrome') > 0&&!/Edge\/12./i.test(navigator.userAgent)&&!/Edge\/13./i.test(navigator.userAgent)){
$('.nectar-video-wrap').each(function(i){
if(jQuery(this).find('video source[type="video/webm"]').length > 0){
var webmSource=jQuery(this).find('video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
var firstVideo=jQuery(this).find('video').get(0);
firstVideo.src=webmSource;
firstVideo.load();
}});
}}
videoBGInit();
var $bodyBorderHeaderColorMatch=($('.body-border-top').css('background-color')=='#ffffff'&&$('body').attr('data-header-color')=='light'||$('.body-border-top').css('background-color')==$('#header-outer').attr('data-user-set-bg')) ? true:false;
var $bodyBorderWidth=($('.body-border-right').length > 0) ? $('.body-border-right').width():0;
var $resetHeader;
if($('#slide-out-widget-area.slide-out-from-right-hover').length > 0){
if($('#ajax-content-wrap > .slide-out-widget-area-toggle').length==0){
$('').insertAfter('#slide-out-widget-area');
if($('#header-outer[data-has-menu="true"]').length > 0||$('body[data-header-search="true"]').length > 0) $('#ajax-content-wrap > .slide-out-widget-area-toggle').addClass('small');
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/))
$('body').on('mouseenter','#header-outer .slide-out-widget-area-toggle:not(.std-menu) a',openRightHoverNav);
else
$('body').on('click','.slide-out-widget-area-toggle:not(.std-menu) a',openRightHoverNav);
$(window).on('smartresize',calculateHoverNavMinHeight);
function calculateHoverNavMinHeight(){
$widgetHeights=0;
$('#slide-out-widget-area > .widget').each(function(){
$widgetHeights +=$(this).height();
});
$menuHeight=(($('#slide-out-widget-area').height() - 25 - $('.bottom-meta-wrap').outerHeight(true) -$widgetHeights) > $('#slide-out-widget-area .off-canvas-menu-container').height()) ? $('#slide-out-widget-area').height() - 25 - $('.bottom-meta-wrap').outerHeight(true) -$widgetHeights:$('#slide-out-widget-area .off-canvas-menu-container').height();
$('#slide-out-widget-area .inner').css({'height':'auto', 'min-height': $menuHeight });
$('#slide-out-widget-area.slide-out-from-right-hover > .inner .off-canvas-menu-container').transition({ y:'-' + ($('#slide-out-widget-area.slide-out-from-right-hover > .inner .off-canvas-menu-container').height()/2) + 'px' },0);
}
function openRightHoverNav(){
calculateHoverNavMinHeight();
if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)&&$('.slide-out-widget-area-toggle .unhidden-line').length > 0){
mobileCloseNavCheck();
return;
}
$('#slide-out-widget-area').css({ 'transform': 'translate3d(0,0,0)' }).addClass('open');
$('.slide-out-hover-icon-effect .lines-button').removeClass('no-delay').addClass('unhidden-line');
if($('#header-outer[data-permanent-transparent="1"]').length==0&&$('#nectar_fullscreen_rows').length==0){
if(!($(window).scrollTop()==0&&$('#header-outer.transparent').length > 0)){
$('#header-outer').attr('data-transparent','true').addClass('no-bg-color').addClass('slide-out-hover');
$('#header-outer header').addClass('all-hidden');
}
var headerResize=$('#header-outer').attr('data-header-resize');
if(headerResize==1){
$(window).off('scroll',bigNav);
$(window).off('scroll',smallNav);
}else{
$(window).off('scroll',opaqueCheck);
$(window).off('scroll',transparentCheck);
}}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/))
$(window).on('mousemove.rightOffsetCheck',closeNavCheck);
}
function closeNavCheck(e){
var $windowWidth=$(window).width();
if(e.clientX < $windowWidth - 340 - $bodyBorderWidth){
$(window).off('mousemove.rightOffsetCheck',closeNavCheck);
$('#slide-out-widget-area').css({ 'transform': 'translate3d(341px,0,0)' }).removeClass('open');
$('#header-outer').removeClass('style-slide-out-from-right');
$('.slide-out-hover-icon-effect .lines-button').removeClass('unhidden-line').addClass('no-delay');
if($('#header-outer[data-permanent-transparent="1"]').length==0){
if(!($(window).scrollTop()==0&&$('#header-outer.transparent').length > 0)){
$('#header-outer').removeClass('no-bg-color');
$('#header-outer header').removeClass('all-hidden');
}
var headerResize=$('#header-outer').attr('data-header-resize');
if(headerResize==1){
$(window).off('scroll.headerResizeEffect');
if($(window).scrollTop()==0){
$(window).on('scroll.headerResizeEffect',smallNav);
if($('#header-outer[data-full-width="true"][data-transparent-header="true"]').length > 0&&$('.body-border-top').length > 0&&$bodyBorderHeaderColorMatch==true&&$('#header-outer.pseudo-data-transparent').length > 0){
$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
'padding':'0'
},{queue:false, duration:250, easing: 'easeOutCubic'});
}}else{
$(window).on('scroll.headerResizeEffect',bigNav);
}}else{
$(window).off('scroll.headerResizeEffectOpaque');
$(window).on('scroll.headerResizeEffectOpaque',opaqueCheck);
}}
}}
function mobileCloseNavCheck(e){
$('#slide-out-widget-area').css({ 'transform': 'translate3d(341px,0,0)' }).removeClass('open');
$('#header-outer').removeClass('style-slide-out-from-right');
$('.slide-out-hover-icon-effect .lines-button').removeClass('unhidden-line').addClass('no-delay');
if($('#header-outer[data-permanent-transparent="1"]').length==0){
$('#header-outer').removeClass('no-bg-color');
$('#header-outer header').removeClass('all-hidden');
}}
}
$('body').on('click','.slide-out-widget-area-toggle:not(.std-menu) a.closed:not(.animating)',function(){
if(animating=='true'||$('.slide-out-from-right-hover').length > 0) return false;
var $that=$(this);
if($('#slide-out-widget-area').hasClass('slide-out-from-right')){
$('#slide-out-widget-area .inner').css({'height':'auto', 'min-height': $('#slide-out-widget-area').height() - 25 - $('.bottom-meta-wrap').height() });
if($('#boxed').length==0){
$('.container-wrap, .home-wrap, #header-secondary-outer, #footer-outer:not(#nectar_fullscreen_rows #footer-outer), .nectar-box-roll, .parallax_slider_outer .swiper-slide .image-bg, .parallax_slider_outer .swiper-slide .video-wrap, .parallax_slider_outer .swiper-slide .mobile-video-image, .parallax_slider_outer .swiper-slide .container, #page-header-wrap .page-header-bg-image, #page-header-wrap .nectar-video-wrap, #page-header-wrap .mobile-video-image, #page-header-wrap #page-header-bg > .container, .page-header-no-bg, div:not(.container) > .project-title').stop(true).transition({ x: '-300px' },700,'easeInOutCubic');
if($('#header-outer[data-format="centered-logo-between-menu"]').length==0){
if($('#header-outer[data-transparency-option="1"]').length==0){
$('#header-outer').stop(true).css('transform','translateY(0)').transition({ x: '-300px'},700,'easeInOutCubic');
}else{
$('#header-outer').stop(true).css('transform','translateY(0)').transition({ x: '-300px', 'background-color':'transparent', 'border-bottom': '1px solid rgba(255,255,255,0.22)' },700,'easeInOutCubic');
}}else{
$('#header-outer header#top nav > ul.buttons, #header-outer .cart-outer .cart-menu-wrap').transition({ x: '-300px'},700,'easeInOutCubic');
}
$('#ascrail2000').transition({ 'x': '-300px' },700,'easeInOutCubic');
$('body:not(.ascend) #header-outer .cart-menu').stop(true).transition({ 'x': '300px' },700,'easeInOutCubic');
}
$slideOutAmount=($('.body-border-top').length > 0&&$('body.mobile').length==0) ? '-'+$('.body-border-top').height()+'px':0;
$('#slide-out-widget-area').stop(true).transition({ x: $slideOutAmount },700,'easeInOutCubic').addClass('open');
if($('#boxed').length==0){
if($('#header-outer[data-full-width="true"]').length > 0&&!$('body').hasClass('mobile')){
$('#header-outer').addClass('highzI');
$('#ascrail2000').addClass('z-index-adj');
if($('#header-outer[data-format="centered-logo-between-menu"]').length==0){
$('header#top #logo').stop(true).transition({ x: '300px' },700,'easeInOutCubic');
$('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': $(window).width() - 360, 'left': '300px' },700,'easeInOutCubic');
}
$('header#top .slide-out-widget-area-toggle .lines-button').addClass('close');
if($('#header-outer[data-remove-border="true"]').length > 0){
$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '64px' },700,'easeInOutCubic');
}else{
$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '89px' },700,'easeInOutCubic');
}
$('body #header-outer nav > ul > li > a').css({'margin-bottom':'0'});
}}
$('#header-outer').addClass('style-slide-out-from-right');
$('#slide-out-widget-area-bg').css({'height':'100%','width':'100%'}).stop(true).transition({
'opacity':1
},700,'easeInOutCubic',function(){
$('.slide-out-widget-area-toggle:not(.std-menu) > div > a').removeClass('animating');
});
if($('#header-outer[data-format="centered-logo-between-menu"]').length==0){
$logoWidth=($('#logo img:visible').length > 0) ? $('#logo img:visible').width():$('#logo').width();
if($('header#top nav > .sf-menu').offset().left - $logoWidth - 300 < 20) $('#header-outer').addClass('hidden-menu');
}else{
$('#header-outer').addClass('hidden-menu-items');
}
var headerResize=$('#header-outer').attr('data-header-resize');
if($bodyBorderHeaderColorMatch==true&&headerResize==1){
$('#header-outer').stop(true).transition({ y: '0' },0).addClass('transparent');
if($('#header-outer').attr('data-transparent-header')!='true'){
$('#header-outer').attr('data-transparent-header','true').addClass('pseudo-data-transparent');
}
$(window).off('scroll',bigNav);
if($('.small-nav').length > 0||$('#header-outer').hasClass('pseudo-data-transparent')) bigNav();
$(window).off('scroll',smallNav);
}else if($bodyBorderHeaderColorMatch==true){
$('#header-outer').addClass('transparent');
$(window).off('scroll',opaqueCheck);
$(window).off('scroll',transparentCheck);
}}
else if($('#slide-out-widget-area').hasClass('fullscreen')){
var $scrollDelay=0;
var $scrollDelay2=0;
if($(window).scrollTop() + $(window).height() > $('.blurred-wrap').height()&&$('#nectar_fullscreen_rows').length==0){
$('body,html').stop().animate({
scrollTop: $('.blurred-wrap').height() - $(window).height()
},600,'easeInOutCubic');
$scrollDelay=550;
$scrollDelay2=200;
}
$('header#top .slide-out-widget-area-toggle:not(.std-menu) .lines-button').addClass('close');
setTimeout(function(){ $('.blurred-wrap').addClass('blurred'); },$scrollDelay);
$('#slide-out-widget-area.fullscreen').show().addClass('open');
hideToTop();
$('.container-wrap').addClass('no-shadow');
$('#header-outer').stop(true).css('transform','translateY(0)');
setTimeout(function(){
$('.off-canvas-menu-container .menu > li').each(function(i){
$(this).delay(i*50).transition({y: 0, 'opacity': 1},800,'easeOutExpo');
});
$('#slide-out-widget-area.fullscreen .widget').each(function(i){
$(this).delay(i*100).transition({y: 0, 'opacity': 1},800,'easeOutExpo');
});
},370+$scrollDelay2);
setTimeout(function(){
$('#slide-out-widget-area .off-canvas-social-links').addClass('line-shown');
$('#slide-out-widget-area .off-canvas-social-links li').each(function(i){
$(this).delay(i*50).transition({'scale':1},400,'easeOutCubic');
});
$('#slide-out-widget-area .bottom-text').transition({'opacity':0.7},400,'easeOutCubic');
},750+$scrollDelay2);
setTimeout(function(){
$easing=($('body.mobile').length > 0) ? 'easeOutCubic':'easeInOutQuint';
$('#slide-out-widget-area-bg').css({'height':'100%','width':'100%'}).show().stop(true).transition({
'y':'0%'
},920,$easing,function(){
$('.slide-out-widget-area-toggle > div > a').removeClass('animating');
});
},50+$scrollDelay2);
slideOutWidgetOverflowState();
if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0&&$('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').addClass('at-content');
if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0||$('.mobile').length==0&&$('#header-outer.transparent').length==0) $('#slide-out-widget-area.fullscreen .inner-wrap').css('padding-top', $('#header-outer').height());
}
else if($('#slide-out-widget-area').hasClass('fullscreen-alt')){
$('header#top .slide-out-widget-area-toggle:not(.std-menu) .lines-button').addClass('close');
$('#slide-out-widget-area.fullscreen-alt').show().addClass('open');
$('#slide-out-widget-area-bg').addClass('open');
$('body > div[class*="body-border"]').css('z-index','9995');
$('.off-canvas-menu-container .menu').transition({y: '0px', 'opacity': 1},0);
hideToTop();
if($('#header-outer-bg-only').length==0){
$('body').prepend($(''));
$('#header-outer-bg-only').css({'height':$('#header-outer').outerHeight(true), 'background-color': $('#header-outer').css('background-color')});
}
if($('#header-outer.transparent').length==0){
$('#header-outer-bg-only').show();
$('#header-outer-bg-only').css({'height':$('#header-outer').outerHeight(true), 'background-color': $('#header-outer').css('background-color')});
if($('.body-border-top').length > 0){
}}else{
$('#header-outer-bg-only').hide();
if($('.body-border-top').length > 0){
$('.admin-bar #slide-out-widget-area-bg.fullscreen-alt').addClass('no-transition').css({'padding-top': ($('.body-border-top').outerHeight(true)+32) + 'px'});
$('body:not(.admin-bar) #slide-out-widget-area-bg.fullscreen-alt').addClass('no-transition').css({'padding-top': ($('.body-border-top').outerHeight(true))+ 'px'});
}}
if($('#logo .starting-logo').length > 0&&$(window).width() > 1000){
$('#header-outer').addClass('no-transition').addClass('no-bg-color');
$('#header-outer').stop(true).css('transform','translateY(0)').addClass('transparent');
if($('#header-outer').attr('data-transparent-header')!='true'){
$('#header-outer').attr('data-transparent-header','true').addClass('pseudo-data-transparent');
}}
$('.off-canvas-menu-container .clip-wrap').css('transition-duration','0s');
setTimeout(function(){
$('.off-canvas-menu-container .menu > li').each(function(i){
$(this).delay(i*50).transition({y: 0, 'opacity': 1},750,'easeOutCubic').addClass('no-pointer-events');
});
setTimeout(function(){
$('.off-canvas-menu-container .menu > li').removeClass('no-pointer-events');
$('.off-canvas-menu-container .clip-wrap').css('transition-duration','.45s');
},500);
$('#slide-out-widget-area.fullscreen-alt .widget').each(function(i){
$(this).delay(i*100).transition({y: 0, 'opacity': 1},650,'easeOutCubic');
});
},200);
setTimeout(function(){
$('#slide-out-widget-area .off-canvas-social-links').addClass('line-shown');
$('#slide-out-widget-area .off-canvas-social-links li').css('opacity','1').each(function(i){
$(this).delay(i*50).transition({'scale':1},400,'easeOutCubic');
});
$('#slide-out-widget-area .bottom-text').transition({'opacity':1},600,'easeOutCubic');
},200);
if($('#slide-out-widget-area-bg').hasClass('solid')) $opacity=1;
if($('#slide-out-widget-area-bg').hasClass('dark')) $opacity=0.97;
if($('#slide-out-widget-area-bg').hasClass('medium')) $opacity=0.6;
if($('#slide-out-widget-area-bg').hasClass('light')) $opacity=0.4;
$('#slide-out-widget-area-bg').removeClass('no-transition');
setTimeout(function(){
$('#slide-out-widget-area-bg').addClass('padding-removed').css({'height':'100%','width':'100%', 'left':'0','opacity': $opacity});
},50);
setTimeout(function(){
$('.slide-out-widget-area-toggle > div > a').removeClass('animating');
},600);
slideOutWidgetOverflowState();
if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0&&$('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').addClass('at-content');
if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0||$('.mobile').length==0&&$('#header-outer.transparent').length==0) $('#slide-out-widget-area.fullscreen-alt .inner-wrap').css('padding-top', $('#header-outer').height());
}
$('#header-outer').removeClass('side-widget-closed').addClass('side-widget-open');
if($('#header-outer[data-transparency-option="1"]').length > 0&&$('#boxed').length==0&&$('#header-outer[data-full-width="true"]').length > 0){
$('#header-outer').addClass('transparent');
}
if($('#header-outer.dark-slide.transparent').length > 0&&$('#boxed').length==0) $('#header-outer').removeClass('dark-slide').addClass('temp-removed-dark-slide');
$('.slide-out-widget-area-toggle > div > a').removeClass('closed').addClass('open');
$('.slide-out-widget-area-toggle > div > a').addClass('animating');
return false;
});
$('body').on('click','.slide-out-widget-area-toggle:not(.std-menu) a.open:not(.animating), #slide-out-widget-area .slide_out_area_close, #slide-out-widget-area-bg.slide-out-from-right',function(){
if($('.slide-out-widget-area-toggle:not(.std-menu) a.animating').length > 0) return;
var $that=$(this);
$('.slide-out-widget-area-toggle:not(.std-menu) a').removeClass('open').addClass('closed');
$('.slide-out-widget-area-toggle:not(.std-menu) a').addClass('animating');
if($('#slide-out-widget-area').hasClass('slide-out-from-right')){
$('.container-wrap, .home-wrap, #header-secondary-outer, #footer-outer:not(#nectar_fullscreen_rows #footer-outer), .nectar-box-roll, .parallax_slider_outer .swiper-slide .image-bg, .parallax_slider_outer .swiper-slide .container, .parallax_slider_outer .swiper-slide .video-wrap, .parallax_slider_outer .swiper-slide .mobile-video-image, #page-header-wrap .page-header-bg-image, #page-header-wrap .nectar-video-wrap, #page-header-wrap .mobile-video-image, #page-header-wrap #page-header-bg > .container, .page-header-no-bg, div:not(.container) > .project-title').stop(true).transition({ x: '0px' },700,'easeInOutCubic');
if($('#header-outer[data-transparency-option="1"]').length > 0&&$('#boxed').length==0){
$currentRowBG=($('#header-outer[data-current-row-bg-color]').length > 0) ? $('#header-outer').attr('data-current-row-bg-color'):$('#header-outer').attr('data-user-set-bg');
$('#header-outer').stop(true).transition({ x: '0px', 'background-color': $currentRowBG },700,'easeInOutCubic');
}else{
$('#header-outer').stop(true).transition({ x: '0px' },700,'easeInOutCubic');
}
$('#ascrail2000').stop(true).transition({ 'x': '0px' },700,'easeInOutCubic');
$('body:not(.ascend) #header-outer .cart-menu').stop(true).transition({ 'x': '0px' },700,'easeInOutCubic');
$('#slide-out-widget-area').stop(true).transition({ x: '301px' },700,'easeInOutCubic').removeClass('open');
if($('#boxed').length==0){
if($('#header-outer[data-full-width="true"]').length > 0){
$('#header-outer').removeClass('highzI');
$('header#top #logo').stop(true).transition({ x: '0px' },700,'easeInOutCubic');
$('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': '100%', 'left': '0' },700,'easeInOutCubic');
$('.lines-button').removeClass('close');
$('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '0px' },700,'easeInOutCubic');
}}
if($('#header-outer[data-format="centered-logo-between-menu"]').length > 0){
$('#header-outer header#top nav > ul.buttons, #header-outer .cart-outer .cart-menu-wrap').stop(true).transition({ x: '0px' },700,'easeInOutCubic');
}
$('#slide-out-widget-area-bg').stop(true).transition({
'opacity':0
},700,'easeInOutCubic',function(){
$('.slide-out-widget-area-toggle a').removeClass('animating');
$(this).css({'height':'1px','width':'1px'});
if($('#header-outer').hasClass('parallax-contained')&&$(window).scrollTop() > 0&&$('#header-outer[data-permanent-transparent="1"]').length==0){
$('#header-outer').removeClass('parallax-contained').addClass('detached').removeClass('transparent');
}
else if($(window).scrollTop()==0&&$('body[data-hhun="1"]').length > 0&&$('#page-header-bg[data-parallax="1"]').length > 0 ||
$(window).scrollTop()==0&&$('body[data-hhun="1"]').length > 0&&$('.parallax_slider_outer').length > 0){
if($('#header-outer[data-transparency-option="1"]').length > 0) $('#header-outer').addClass('transparent');
$('#header-outer').addClass('parallax-contained').removeClass('detached');
}
$('.container-wrap').css('transform','none');
});
$('#header-outer').removeClass('style-slide-out-from-right');
var headerResize=$('#header-outer').attr('data-header-resize');
if($bodyBorderHeaderColorMatch==true&&headerResize==1){
$(window).off('scroll.headerResizeEffect');
if($(window).scrollTop()==0){
$(window).on('scroll.headerResizeEffect',smallNav);
if($('#header-outer[data-full-width="true"][data-transparent-header="true"]').length > 0&&$('.body-border-top').length > 0&&$bodyBorderHeaderColorMatch==true&&$('#header-outer.pseudo-data-transparent').length > 0){
$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
'padding':'0'
},{queue:false, duration:250, easing: 'easeOutCubic'});
}}
else
smallNav();
if($('#header-outer').hasClass('pseudo-data-transparent')){
$('#header-outer').attr('data-transparent-header','false').removeClass('pseudo-data-transparent').removeClass('transparent');
}}else if($bodyBorderHeaderColorMatch==true){
$(window).off('scroll.headerResizeEffectOpaque');
$(window).on('scroll.headerResizeEffectOpaque',opaqueCheck);
}}
else if($('#slide-out-widget-area').hasClass('fullscreen')){
$('.slide-out-widget-area-toggle:not(.std-menu) .lines-button').removeClass('close');
$('.blurred-wrap').removeClass('blurred');
$('#slide-out-widget-area.fullscreen').transition({'opacity': 0 },700,'easeOutQuad',function(){ $('#slide-out-widget-area.fullscreen').hide().css('opacity','1'); }).removeClass('open');
$('#slide-out-widget-area.fullscreen .widget').transition({'opacity': 0},700,'easeOutQuad',function(){
$(this).transition({y: '110px'},0);
});
setTimeout(function(){
$('.off-canvas-menu-container .menu > li').transition({y: '80px', 'opacity': 0},0);
$('#slide-out-widget-area .off-canvas-social-links li').transition({'scale':0},0);
$('#slide-out-widget-area .off-canvas-social-links').removeClass('line-shown');
$('#slide-out-widget-area .bottom-text').transition({'opacity':0},0);
$('#slide-out-widget-area .menuwrapper .menu').removeClass('subview');
$('#slide-out-widget-area .menuwrapper .menu li').removeClass('subview subviewopen');
$('#slide-out-widget-area.fullscreen .inner .off-canvas-menu-container').css('height','auto');
},800);
setTimeout(function(){
showToTop();
$('.container-wrap').removeClass('no-shadow');
},500);
$('#slide-out-widget-area-bg').stop(true).transition({'opacity': 0},900,'easeOutQuad',function(){
if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0&&$('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').removeClass('at-content');
if($('.mobile #header-outer[data-permanent-transparent="false"]').length==0) $('#slide-out-widget-area.fullscreen .inner-wrap').css('padding-top', '0');
$('.slide-out-widget-area-toggle a').removeClass('animating');
if($('#slide-out-widget-area-bg').hasClass('solid')) $opacity=1;
if($('#slide-out-widget-area-bg').hasClass('dark')) $opacity=0.93;
if($('#slide-out-widget-area-bg').hasClass('medium')) $opacity=0.6;
if($('#slide-out-widget-area-bg').hasClass('light')) $opacity=0.4;
$(this).css({'height':'1px','width':'1px', 'opacity': $opacity}).transition({ y:'-100%'},0);
});
}
else if($('#slide-out-widget-area').hasClass('fullscreen-alt')){
$('.slide-out-widget-area-toggle:not(.std-menu) .lines-button').removeClass('close');
$('.blurred-wrap').removeClass('blurred');
$('#slide-out-widget-area-bg').removeClass('open');
$('#slide-out-widget-area.fullscreen-alt .widget').transition({'opacity': 0},500,'easeOutQuad',function(){
$(this).transition({y: '40px'},0);
});
$('#slide-out-widget-area .bottom-text, #slide-out-widget-area .off-canvas-social-links li').transition({'opacity': 0},250,'easeOutQuad');
$('#slide-out-widget-area .off-canvas-social-links').removeClass('line-shown');
$('.off-canvas-menu-container .menu').transition({y: '-13px', 'opacity': 0},400);
setTimeout(function(){
$('.off-canvas-menu-container .menu > li').stop(true,true).transition({y: '40px', 'opacity': 0},0);
$('#slide-out-widget-area .off-canvas-social-links li').transition({'scale':0},0);
$('#slide-out-widget-area .off-canvas-social-links').removeClass('line-shown');
$('#slide-out-widget-area .menuwrapper .menu').removeClass('subview');
$('#slide-out-widget-area .menuwrapper .menu li').removeClass('subview subviewopen');
$('#slide-out-widget-area.fullscreen-alt .inner .off-canvas-menu-container').css('height','auto');
if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0&&$('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').removeClass('at-content');
if($('.mobile #header-outer[data-permanent-transparent="false"]').length==0) $('#slide-out-widget-area.fullscreen-alt .inner-wrap').css('padding-top', '0');
$('.slide-out-widget-area-toggle a').removeClass('animating');
$('#slide-out-widget-area-bg').css({'height':'1px','width':'1px','left':'-100%'});
$('#slide-out-widget-area.fullscreen-alt').hide().removeClass('open');
},550);
setTimeout(function(){
showToTop();
},600);
setTimeout(function(){
$('#slide-out-widget-area-bg').removeClass('padding-removed');
},50);
var borderDelay=($bodyBorderHeaderColorMatch==true) ? 250: 50;
setTimeout(function(){
$('#slide-out-widget-area-bg').stop(true).css({'opacity': 0});
$('body > div[class*="body-border"]').css('z-index','10000');
},borderDelay);
setTimeout(function(){
$('#header-outer.transparent.small-nav, #header-outer.transparent.detached, #header-outer.transparent.scrolled-down').removeClass('transparent');
if($('#header-outer').hasClass('pseudo-data-transparent')){
$('#header-outer').attr('data-transparent-header','false').removeClass('pseudo-data-transparent').removeClass('transparent');
}
setTimeout(function(){
$('#header-outer').removeClass('no-bg-color');
$('#header-outer-bg-only').hide();
setTimeout(function(){
$('#header-outer').removeClass('no-transition');
},50);
},250);
},100);
}
if($('#header-outer.temp-removed-dark-slide.transparent').length > 0&&$('#boxed').length==0) $('#header-outer').removeClass('temp-removed-dark-slide').addClass('dark-slide');
if($('#header-outer[data-permanent-transparent="1"]').length==0&&$('#slide-out-widget-area.fullscreen-alt').length==0){
if($('.nectar-box-roll').length==0){
if($('#header-outer.small-nav').length > 0||$('#header-outer.scrolled-down').length > 0||$('#header-outer.detached').length > 0) $('#header-outer').removeClass('transparent');
}else{
if($('#header-outer.small-nav').length > 0||$('#header-outer.scrolled-down').length > 0||$('.container-wrap.auto-height').length > 0) $('#header-outer').removeClass('transparent');
}}
$('#header-outer').removeClass('hidden-menu');
$('#header-outer').removeClass('side-widget-open').addClass('side-widget-closed');
return false;
});
function slideOutWidgetOverflowState(){
if(window.innerWidth < 1000||$('body > #boxed').length > 0){
$('#slide-out-widget-area.fullscreen .off-canvas-social-links, #slide-out-widget-area.fullscreen-alt .off-canvas-social-links').appendTo('#slide-out-widget-area .inner');
$('#slide-out-widget-area.fullscreen .bottom-text, #slide-out-widget-area.fullscreen-alt .bottom-text').appendTo('#slide-out-widget-area .inner');
}else{
$('#slide-out-widget-area.fullscreen .off-canvas-social-links,#slide-out-widget-area.fullscreen-alt .off-canvas-social-links').appendTo('#slide-out-widget-area .inner-wrap');
$('#slide-out-widget-area.fullscreen .bottom-text, #slide-out-widget-area.fullscreen-alt .bottom-text').appendTo('#slide-out-widget-area .inner-wrap');
}
if($('#slide-out-widget-area[class*="fullscreen"] .inner').height() >=$(window).height()-100){ $('#slide-out-widget-area[class*="fullscreen"] .inner, #slide-out-widget-area[class*="fullscreen"]').addClass('overflow-state'); }else{ $('#slide-out-widget-area[class*="fullscreen"] .inner, #slide-out-widget-area[class*="fullscreen"]').removeClass('overflow-state'); }
$('#slide-out-widget-area[class*="fullscreen"] .inner').transition({ y:'-' + ($('#slide-out-widget-area[class*="fullscreen"] .inner').height()/2) + 'px' },0);
if($('.slide-out-from-right.open .off-canvas-menu-container.mobile-only').length > 0&&$('body.mobile').length==0) $('#slide-out-widget-area .slide_out_area_close').trigger('click');
}
function fullWidthHeaderSlidingWidgetMenuCalc(){
$('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': $(window).width() - 360, 'left': '300px' },700,'easeInOutCubic');
}
function slideOutWidgetAreaScrolling(){
$('#slide-out-widget-area').mousewheel(function(event, delta){
this.scrollTop -=(delta * 30);
event.preventDefault();
});
}
slideOutWidgetAreaScrolling();
if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
$('#slide-out-widget-area').addClass('mobile');
}
function closeOCM(item){
if($('#slide-out-widget-area.open').length > 0){
var $windowCurrentLocation=window.location.href.split("#")[0];
var $windowClickedLocation=item.find('> a').attr('href').split("#")[0];
if($windowCurrentLocation==$windowClickedLocation||item.find('a[href^="#"]').length > 0)
$('.slide-out-widget-area-toggle a').trigger('click');
}}
;(function($, window, undefined){
'use strict';
var Modernizr=window.Modernizr, $body=$('body');
$.DLMenu=function(options, element){
this.$el=$(element);
this._init(options);
};
$.DLMenu.defaults={
animationClasses:{ classin:'dl-animate-in-1', classout:'dl-animate-out-1' },
onLevelClick:function(el, name){ return false; },
onLinkClick:function(el, ev){ return false; }};
$.DLMenu.prototype={
_init:function(options){
this.options=$.extend(true, {}, $.DLMenu.defaults, options);
this._config();
var animEndEventNames={
'WebkitAnimation':'webkitAnimationEnd',
'OAnimation':'oAnimationEnd',
'msAnimation':'MSAnimationEnd',
'animation':'animationend'
},
transEndEventNames={
'WebkitTransition':'webkitTransitionEnd',
'MozTransition':'transitionend',
'OTransition':'oTransitionEnd',
'msTransition':'MSTransitionEnd',
'transition':'transitionend'
};
this.animEndEventName=animEndEventNames[ Modernizr.prefixed('animation') ] + '.menu';
this.transEndEventName=transEndEventNames[ Modernizr.prefixed('transition') ] + '.menu',
this.supportAnimations=Modernizr.cssanimations,
this.supportTransitions=Modernizr.csstransitions;
this._initEvents();
},
_config:function(){
this.open=false;
this.$trigger=this.$el.children('.trigger');
this.$menu=this.$el.children('ul.menu');
this.$menuitems=this.$menu.find('li:not(.back) > a');
this.$el.find('ul.sub-menu').prepend(' '+$('#slide-out-widget-area').attr('data-back-txt')+' ');
this.$back=this.$menu.find('li.back');
},
_initEvents:function(){
var self=this;
this.$trigger.on('click.menu', function(){
if(self.open){
self._closeMenu();
}else{
self._openMenu();
}
return false;
});
this.$menuitems.on('click.menu', function(event){
var $item=$(this).parent('li'),
$submenu=$item.children('ul.sub-menu');
$('.fullscreen-alt .off-canvas-menu-container .clip-wrap, .fullscreen-alt .off-canvas-menu-container .clip-wrap span').css('transition-duration','0s');
if($submenu.length > 0){
var $flyin=$submenu.clone().css('opacity', 0).insertAfter(self.$menu),
onAnimationEndFn=function(){
self.$menu.off(self.animEndEventName).removeClass(self.options.animationClasses.classout).addClass('subview');
$item.addClass('subviewopen').parents('.subviewopen:first').removeClass('subviewopen').addClass('subview');
$flyin.remove();
setTimeout(function(){
$('.off-canvas-menu-container .menu > li').removeClass('no-pointer-events');
$('.off-canvas-menu-container .clip-wrap, .off-canvas-menu-container .clip-wrap span').css('transition-duration','.45s');
},300);
};
setTimeout(function(){
$flyin.addClass(self.options.animationClasses.classin);
self.$menu.addClass(self.options.animationClasses.classout);
if(self.supportAnimations){
self.$menu.on(self.animEndEventName, onAnimationEndFn);
}else{
onAnimationEndFn.call();
}
self.options.onLevelClick($item, $item.children('a:first').text());
});
$item.parents('.off-canvas-menu-container').css('height',$item.parents('.off-canvas-menu-container').find('.menuwrapper .menu').height()).transition({ 'height': $flyin.height() },500,'easeInOutQuad');
return false;
}else{
self.options.onLinkClick($item.find('> a'), event);
}
closeOCM($item);
});
this.$back.on('click.menu', function(event){
var $this=$(this),
$submenu=$this.parents('ul.sub-menu:first'),
$item=$submenu.parent(),
$flyin=$submenu.clone().insertAfter(self.$menu);
var onAnimationEndFn=function(){
self.$menu.off(self.animEndEventName).removeClass(self.options.animationClasses.classin);
$flyin.remove();
};
setTimeout(function(){
$flyin.addClass(self.options.animationClasses.classout);
self.$menu.addClass(self.options.animationClasses.classin);
if(self.supportAnimations){
self.$menu.on(self.animEndEventName, onAnimationEndFn);
}else{
onAnimationEndFn.call();
}
$item.removeClass('subviewopen');
var $subview=$this.parents('.subview:first');
if($subview.is('li')){
$subview.addClass('subviewopen');
}
$subview.removeClass('subview');
});
$item.parents('.off-canvas-menu-container').css('height', $item.parents('.off-canvas-menu-container').find('.menuwrapper .menu').height())
setTimeout(function(){
$item.parents('.off-canvas-menu-container').transition({ 'height': $item.parent().height() },500,'easeInOutQuad');
},50);
return false;
});
},
closeMenu:function(){
if(this.open){
this._closeMenu();
}},
_closeMenu:function(){
var self=this,
onTransitionEndFn=function(){
self.$menu.off(self.transEndEventName);
self._resetMenu();
};
this.$menu.removeClass('menuopen');
this.$menu.addClass('menu-toggle');
this.$trigger.removeClass('active');
if(this.supportTransitions){
this.$menu.on(this.transEndEventName, onTransitionEndFn);
}else{
onTransitionEndFn.call();
}
this.open=false;
},
openMenu:function(){
if(!this.open){
this._openMenu();
}},
_openMenu:function(){
var self=this;
$body.off('click').on('click.menu', function(){
self._closeMenu() ;
});
this.$menu.addClass('menuopen menu-toggle').on(this.transEndEventName, function(){
$(this).removeClass('menu-toggle');
});
this.$trigger.addClass('active');
this.open=true;
},
_resetMenu:function(){
this.$menu.removeClass('subview');
this.$menuitems.removeClass('subview subviewopen');
}};
var logError=function(message){
if(window.console){
window.console.error(message);
}};
$.fn.dlmenu=function(options){
if(typeof options==='string'){
var args=Array.prototype.slice.call(arguments, 1);
this.each(function(){
var instance=$.data(this, 'menu');
if(!instance){
logError("cannot call methods on menu prior to initialization; " +
"attempted to call method '" + options + "'");
return;
}
if(!$.isFunction(instance[options])||options.charAt(0)==="_"){
logError("no such method '" + options + "' for menu instance");
return;
}
instance[ options ].apply(instance, args);
});
}else{
this.each(function(){
var instance=$.data(this, 'menu');
if(instance){
instance._init();
}else{
instance=$.data(this, 'menu', new $.DLMenu(options, this));
}});
}
return this;
};})(jQuery, window);
function fullscreenMenuInit(){
$('#slide-out-widget-area .off-canvas-menu-container .menu').wrap('');
$('#slide-out-widget-area .off-canvas-menu-container .menu').addClass('menuopen');
$ocmAnimationClassNum=($('#slide-out-widget-area.fullscreen-alt').length > 0) ? '4':'5';
$('#slide-out-widget-area .off-canvas-menu-container .menu-wrap').dlmenu({ animationClasses:{ classin:'dl-animate-in-'+$ocmAnimationClassNum, classout:'dl-animate-out-'+$ocmAnimationClassNum }});
$('#slide-out-widget-area.fullscreen-alt .menu li, #slide-out-widget-area.slide-out-from-right-hover .menu li').each(function(){
var $menuItemText=$(this).find('> a').html();
$(this).find('> a ').html($menuItemText.replace(/ /g, " "));
$(this).find('> a').append(''+$(this).find('> a').text()+'');
});
$('body').on('mouseover','#slide-out-widget-area.fullscreen-alt .menu li a',function(){
var $that=$(this);
$(this).find('> .clip-wrap').css({'transition-duration': '0s' });
$(this).find('> .clip-wrap span ').css({'transition-duration': '0s' });
$that.find('> .clip-wrap').css({'width':'0%', 'transform':'translateX(0%)' });
$that.find('> .clip-wrap span').css({'transform':'translateX(0%)' });
setTimeout(function(){
$that.find('> .clip-wrap').css({'transition-duration': '0.45s' });
$that.find('> .clip-wrap').css({'width':'100%', 'left': '0', 'right': 'auto' });
},50);
});
$('body').on('mouseleave','#slide-out-widget-area.fullscreen-alt .menu li a',function(){
var $that=$(this);
$(this).find('> .clip-wrap').css({'transition-duration': '0s' });
$(this).find('> .clip-wrap span ').css({'transition-duration': '0s' });
$that.find('> .clip-wrap').css({'width':'100%', 'transform':'translateX(0%)' });
$that.find('> .clip-wrap span').css({'transform':'translateX(0%)' });
$that.find('> .clip-wrap').css({'transition-duration': '0.45s' });
$that.find('> .clip-wrap span').css({'transition-duration': '0.45s' });
$that.find('> .clip-wrap').css({'transform':'translateX(100%)'});
$that.find('> .clip-wrap span').css({'transform':'translateX(-100%)'});
});
}
fullscreenMenuInit();
$('body').on('mouseover','#slide-out-widget-area .off-canvas-menu-container .menuwrapper > .sub-menu li > a',function(){
var $currentTxt=$(this).text();
$('.off-canvas-menu-container .menuwrapper .menu li > a').removeClass('hovered');
$('.off-canvas-menu-container .menuwrapper .menu li > a:contains('+$currentTxt+')').addClass('hovered');
});
$('body').on('mouseover','.off-canvas-menu-container .menuwrapper .menu li > a',function(){
$('.off-canvas-menu-container .menuwrapper .menu li > a').removeClass('hovered');
});
var pageHeaderHeight;
var pageHeaderHeightCopy;
var pageHeadingHeight;
var extraSpaceFromResize=($('#header-outer[data-header-resize="1"]').length > 0&&$('.nectar-box-roll').length==0) ? 51:1;
function fullScreenHeaderInit(){
pageHeaderHeight=parseInt($('#page-header-bg').attr('data-height'));
pageHeaderHeightCopy=parseInt($('#page-header-bg').attr('data-height'));
if($('.fullscreen-header').length > 0){
if($('#header-outer[data-transparency-option]').length > 0&&$('#header-outer').attr('data-transparency-option')!='0'){
var calculatedNum=(!$('body').hasClass('mobile')) ? $(window).height():$(window).height() - parseInt($('#header-outer').height()) ;
}else{
var calculatedNum=(!$('body').hasClass('mobile')) ? $(window).height() - parseInt($('#header-space').height()) + extraSpaceFromResize:$(window).height() - parseInt($('#header-outer').height()) ;
}
var extraHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
if($('.nectar-box-roll').length > 0) extraHeight=0;
pageHeaderHeight=calculatedNum - extraHeight;
pageHeaderHeightCopy=calculatedNum - extraHeight;
}
$('#page-header-bg').css('height',pageHeaderHeight+'px').removeClass('not-loaded');
setTimeout(function(){ $('#page-header-bg').css('overflow','visible') },800);
}
fullScreenHeaderInit();
function pageHeader(){
$('#page-header-bg[data-animate-in-effect="zoom-out"]').addClass('loaded');
var $scrollTop=$(window).scrollTop();
if($('.fullscreen-header').length > 0){
if($('#header-outer[data-transparency-option]').length > 0&&$('#header-outer').attr('data-transparency-option')!='0'){
var calculatedNum=(!$('body').hasClass('mobile')) ? $(window).height():$(window).height() - parseInt($('#header-outer').height()) ;
if($('body[data-permanent-transparent="1"]').length > 0) calculatedNum=$(window).height();
}else{
var calculatedNum=(!$('body').hasClass('mobile')) ? $(window).height() - parseInt($('#header-space').height()) + extraSpaceFromResize:$(window).height() - parseInt($('#header-outer').height()) ;
}
var extraHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
if($('.nectar-box-roll').length > 0) extraHeight=0;
pageHeaderHeight=calculatedNum - extraHeight;
pageHeaderHeightCopy=calculatedNum - extraHeight;
}
if(window.innerWidth < 1000&&window.innerWidth > 690&&!$('body').hasClass('salient_non_responsive')){
var $multiplier=($('.fullscreen-header').length > 0) ? 1:1.6;
$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
}else if(window.innerWidth <=690&&window.innerWidth > 480&&!$('body').hasClass('salient_non_responsive')){
var $multiplier=($('.fullscreen-header').length > 0) ? 1:2.1;
$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
}else if(window.innerWidth <=480&&!$('body').hasClass('salient_non_responsive')){
var $multiplier=($('.fullscreen-header').length > 0) ? 1:2.5;
$('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px');
$('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px');
}else{
$('#page-header-bg').attr('data-height', pageHeaderHeightCopy).css('height',pageHeaderHeightCopy +'px');
if($('.fullscreen-header').length > 0){
$('#page-header-wrap').css('height',pageHeaderHeightCopy +'px');
}else{
$('#page-header-wrap').css('height',pageHeaderHeightCopy +'px');
}
if($('#page-header-bg[data-parallax="1"]').length==0) $('#page-header-wrap').css('height',pageHeaderHeightCopy +'px');
}
if(!$('body').hasClass('mobile')){
pageHeaderHeight=parseInt($('#page-header-bg').attr('data-height'));
$('#page-header-bg .container > .row').css('top',0);
var $divisionMultipler=($('#header-outer[data-remove-border="true"]').length > 0) ? 2:1;
pageHeadingHeight=$('#page-header-bg .col.span_6').height();
if($('#header-outer[data-transparent-header="true"]').length > 0&&$('.fullscreen-header').length==0){
$('#page-header-bg:not("[data-parallax=1]") .col.span_6').css('top', ((pageHeaderHeight+$('#header-space').height()/$divisionMultipler)/2) - (pageHeadingHeight/2));
}else{
var $extraResizeHeight=($('#header-outer[data-header-resize="1"]').length > 0) ? 22: 0;
$('#page-header-bg:not("[data-parallax=1]") .col.span_6').css('top', (pageHeaderHeight/2) - (pageHeadingHeight/2) + $extraResizeHeight);
}
$('#page-header-bg:not("[data-parallax=1]") .portfolio-filters').css('top', (pageHeaderHeight/2) + 2);
if($('#page-header-bg[data-parallax="1"] .span_6').css('opacity') > 0){
if($('#header-outer[data-transparent-header="true"]').length > 0&&$('body.single-post .fullscreen-header').length==0){
$('#page-header-bg[data-parallax="1"] .span_6').css({
'opacity':1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+60)),
'top':(((pageHeaderHeight+$('#header-space').height()/$divisionMultipler)/2) - (pageHeadingHeight/2)) +"px"
});
$('#page-header-bg[data-parallax="1"] .portfolio-filters').css({
'opacity':1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)),
'top':($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
});
}else{
$('#page-header-bg[data-parallax="1"] .span_6').css({
'opacity':1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+60)),
'top':((pageHeaderHeight/2) - (pageHeadingHeight/2)) +10 +"px"
});
$('#page-header-bg[data-parallax="1"] .portfolio-filters').css({
'opacity':1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)),
'top':($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px"
});
}}
}else{
pageHeaderHeight=parseInt($('#page-header-bg').attr('data-height'));
var pageHeadingHeight=$('#page-header-bg .container > .row').height();
$('#page-header-bg .container > .row').css('top', (pageHeaderHeight/2) - (pageHeadingHeight/2) + 5);
}
$('#page-header-bg .container > .row').css('visibility','visible');
}
var $pt_timeout=($('body[data-ajax-transitions="true"]').length > 0&&$('#page-header-bg[data-animate-in-effect="slide-down"]').length > 0) ? 350:0;
setTimeout(function(){ pageHeader(); },$pt_timeout);
if($('#header-outer').attr('data-header-resize')==''||$('#header-outer').attr('data-header-resize')=='0'){
$('#page-header-wrap').css('margin-top','0');
}
function extractUrl(input){
return input.replace(/"/g,"").replace(/url\(|\)$/ig, "");
}
if($('#page-header-bg[data-parallax="1"]').length > 0){
var img=new Image();
var imgX, imgY, aspectRatio;
var diffX, diffY;
var pageHeadingHeight=$('#page-header-bg .col.span_6').height();
var pageHeaderHeight=parseInt($('#page-header-bg').attr('data-height'));
var headerPadding2=parseInt($('#header-outer').attr('data-padding'))*2;
var wooCommerceHeader=($('.demo_store').length > 0) ? 32:0 ;
var $initialImgCheck=extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
if($initialImgCheck&&$initialImgCheck.indexOf('.')!==-1){
img.onload=function(){
pageHeaderInit();
}
img.src=extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
}else{
pageHeaderInit();
}
var extraHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
if($('body[data-hhun="1"]').length > 0) $('#header-outer').addClass('parallax-contained');
window.addEventListener('scroll', function(){
window.requestAnimationFrame(bindHeaderParallax);
}, false);
}
function bindHeaderParallax(){
var $scrollTop=$(window).scrollTop();
var pageHeadingHeight=$('#page-header-bg .col.span_6').height();
if(!$('body').hasClass('mobile')&&navigator.userAgent.match(/iPad/i)==null){
var $multiplier1=($('body[data-hhun="1"]').length > 0) ? 0.40: 0.2;
var $multiplier2=($('body[data-hhun="1"]').length > 0) ? 0.09: 0.14;
var $parallaxHeaderHUN=($('#header-outer[data-transparency-option="1"]').length > 0) ? 0.49: 0.4;
if($('#page-header-bg .nectar-particles').length==0&&$('#page-header-bg.out-of-sight').length==0){
$('#page-header-bg[data-parallax="1"]').css({ 'transform': 'translateY('+ $scrollTop*-$multiplier1 +'px)' });
var multipler=($('body').hasClass('single')) ? 1:2;
$('#page-header-bg[data-parallax="1"] .span_6, #page-header-bg[data-parallax="1"][data-post-hs="default_minimal"] .author-section').css({
'opacity':1-($scrollTop/(pageHeaderHeight-60))
});
$('#page-header-bg[data-parallax="1"] .span_6, body[data-button-style="rounded"] #page-header-bg[data-parallax="1"] .section-down-arrow, #page-header-bg[data-parallax="1"][data-post-hs="default_minimal"] .author-section').css({ 'transform': 'translateY('+ $scrollTop*- $multiplier2+'px)' });
if($('#page-header-bg[data-parallax="1"] .span_6').css('opacity')==0){
$('#page-header-bg[data-parallax="1"] .span_6, #page-header-bg[data-parallax="1"] .portfolio-filters').hide();
}else{
$('#page-header-bg[data-parallax="1"] .span_6, #page-header-bg[data-parallax="1"] .portfolio-filters').show();
}
if($('body[data-hhun="1"]').length > 0&&!$('#header-outer').hasClass('side-widget-open')&&!$('#header-outer .slide-out-widget-area-toggle a').hasClass('animating')){
$('#header-outer.parallax-contained').css({ 'transform': 'translateY('+$scrollTop*-$parallaxHeaderHUN+'px)' });
}}
else if($('#page-header-bg.out-of-sight').length==0){
var multipler=($('body').hasClass('single')) ? 1:2;
$('#page-header-wrap .nectar-particles .fade-out').css({
'opacity':0+($scrollTop/(pageHeaderHeight+pageHeaderHeight*$multiplier))
});
}
if(($scrollTop / (pageHeaderHeight + $('#header-space').height() + extraHeight)) > 1){
$('#page-header-bg, .nectar-particles, #page-header-bg .fade-out').css('visibility','hidden').hide().addClass('out-of-sight');
}else{
$('#page-header-bg, .nectar-particles, #page-header-bg .fade-out').css('visibility','visible').show().removeClass('out-of-sight');
pageHeaderHeight=parseInt($('#page-header-bg').attr('data-height'));
$('#page-header-bg .container > .row').css('top',0);
var $divisionMultipler=($('#header-outer[data-remove-border="true"]').length > 0) ? 2:1;
pageHeadingHeight=$('#page-header-bg .col.span_6').height();
if($('#header-outer[data-transparent-header="true"]').length > 0&&$('body.single-post .fullscreen-header').length==0){
$('#page-header-bg[data-parallax="1"] .span_6').css({
'top':(((pageHeaderHeight+$('#header-space').height()/$divisionMultipler)/2) - (pageHeadingHeight/2)) +"px"
});
}else{
$('#page-header-bg[data-parallax="1"] .span_6').css({
'top':((pageHeaderHeight/2) - (pageHeadingHeight/2)) +10 +"px"
});
}}
}}
if($('#page-header-bg').length > 0){
var $initialImgCheckAscend=extractUrl($('#page-header-bg').css('background-image'));
if($initialImgCheckAscend&&$initialImgCheckAscend.indexOf('.')!==-1){
$('#page-header-bg').addClass('has-bg');
}}
function pageHeaderInit(){
var wooCommerceHeader=($('.demo_store').length > 0) ? 32:0 ;
var centeredNavAltSpace=($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) ? $('header#top nav > .sf-menu').height() -20:null;
if($('#header-outer[data-transparent-header="true"]').length > 0){
$('#page-header-bg[data-parallax="1"]').css({'top': extraHeight+wooCommerceHeader });
}else{
var logoHeight=parseInt($('#header-outer').attr('data-logo-height'));
var headerPadding=parseInt($('#header-outer').attr('data-padding'));
var headerPadding2=parseInt($('#header-outer').attr('data-padding'));
var extraDef=10;
var headerResize=($('body').hasClass('pp-video-function')) ? '1':$('#header-outer').attr('data-header-resize');
var headerResizeOffExtra=0;
var extraHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
var usingLogoImage=true;
var mediaElement=($('.wp-video-shortcode').length > 0) ? 36:0;
var secondaryHeader=($('#header-outer').attr('data-using-secondary')=='1') ? 32:0 ;
if($('body[data-header-resize="0"]').length==0) $('#page-header-bg[data-parallax="1"]').css({'top': (logoHeight+headerPadding+centeredNavAltSpace+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader+wooCommerceHeader) + 'px' });
}
if($('#ajax-content-wrap').length==0||!$('body').hasClass('ajax-loaded')){
$('#page-header-bg[data-parallax="1"]').animate({ 'opacity':1},650,'easeInCubic');
}else if($('#ajax-content-wrap').length==1){
$('#page-header-bg[data-parallax="1"]').css({ 'opacity':1});
}
if($smoothCache==true&&$(window).width() > 690&&$('body').outerHeight(true) > $(window).height()&&Modernizr.csstransforms3d&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){ niceScrollInit(); $(window).trigger('resize') }
$('#page-header-bg[data-parallax="1"] .nectar-particles').append('');
}
function nectarPageHeader(){
if($('#page-header-bg').length > 0){
fullScreenHeaderInit();
pageHeader();
}
if($('#page-header-bg[data-parallax="1"]').length > 0){
var img=new Image();
var $initialImgCheck=extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
if($initialImgCheck&&$initialImgCheck.indexOf('.')!==-1){
img.onload=function(){
pageHeaderInit();
}
img.src=extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image'));
}else{
pageHeaderInit();
}
$('#page-header-bg[data-parallax="1"] .span_6').css({
'opacity':1
});
if(window.addEventListener){
window.addEventListener('scroll', function(){
requestAnimationFrame(bindHeaderParallax);
}, false);
}}
if($('#page-header-bg').length > 0){
var $initialImgCheckAscend=extractUrl($('#page-header-bg').css('background-image'));
if($initialImgCheckAscend&&$initialImgCheckAscend.indexOf('.')!==-1){
$('#page-header-bg').addClass('has-bg');
}}
}
if(navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1||navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
window.onunload=function(){ nectarPageHeader(); };}
function pageHeaderTextEffectInit(){
$('#page-header-bg').each(function(){
if($(this).attr('data-text-effect')=='rotate_in'){
var $topHeading='none';
if($(this).find('.span_6 h1').length > 0){
$topHeading='h1';
}
if($topHeading!='none'){
var $selector=($(this).find('.nectar-particles').length > 0) ? '.inner-wrap.shape-1':'.span_6';
$(this).find($selector).find($topHeading).addClass('top-heading').contents().filter(function (){
return this.nodeType===3&&typeof this.data!='undefined'&&this.data.replace(/\s+/, "");
}).wrap('');
$(this).find($selector).find('.wraped').each(function (){
textNode=$(this);
text=textNode.text().split(' ');
replace='';
$.each(text, function (index, value){
if(value.replace(/\s+/, "")){
replace +='' + value + ' ';
}});
textNode.replaceWith($(replace));
});
}}
});
}
function pageHeaderTextEffect(){
if($('#page-header-bg .nectar-particles').length==0&&$('#page-header-bg[data-text-effect="none"]').length==0||$('.nectar-box-roll').length > 0&&$('#page-header-bg .nectar-particles').length==0){
var $selector=($('.nectar-box-roll').length==0) ? '#page-header-bg .span_6':'.nectar-box-roll .overlaid-content .span_6';
$($selector).find('.wraped').each(function(i){
$(this).find('span').delay(i*370).transition({ rotateX: '0', 'opacity':1, y: 0},400,'easeOutQuad');
});
setTimeout(function(){
$($selector).find('.inner-wrap > *:not(.top-heading)').each(function(i){
$(this).delay(i*370).transition({ rotateX: '0', 'opacity':1, y: 0 },650,'easeOutQuad');
});
$('.scroll-down-wrap').removeClass('hidden');
}, $($selector).find('.wraped').length * 370);
}}
var $effectTimeout=($('#ajax-loading-screen').length > 0) ? 800:0;
pageHeaderTextEffectInit();
if($('#page-header-bg .nectar-video-wrap video').length==0) setTimeout(pageHeaderTextEffect,$effectTimeout);
if($('header#top nav > ul.sf-menu ul').length > 0){
var $midnightSubmenuTimeout;
$('body').on('mouseover','#header-outer .midnightHeader .sf-with-ul, #header-outer .midnightHeader .cart-menu',function(){
if($(this).parents('.midnightHeader').offset().top - $(window).scrollTop() < 50){
$(this).parents('.midnightHeader').css({'z-index': '9999'}).addClass('overflow');
$(this).parents('.midnightInner').css('overflow','visible');
}});
$('body').on('mouseleave','#header-outer .midnightHeader',function(){
var $that=$(this);
clearTimeout($midnightSubmenuTimeout);
$midnightSubmenuTimeout=setTimeout(function(){
if(!$that.is(':hover')){
$that.css({'z-index': 'auto'}).removeClass('overflow');
$that.find('.midnightInner').css('overflow','hidden');
}},900);
});
}
function midnightInit(){
if($('#header-outer[data-permanent-transparent="1"]').length > 0&&$('body[data-bg-header="true"]').length > 0){
$('#header-outer').midnight();
if($('#header-outer[data-has-menu="false"]').length > 0&&$('#header-outer[data-format="centered-logo-between-menu"]').length==0){
var $buttonsOffset=($('#social-in-menu').length > 0) ? $('#social-in-menu').position():$('#header-outer header#top nav > ul.buttons').position();
if($('#header-outer #logo img:visible').length > 0){
var $logoOffset=$('#header-outer #logo img:visible').position();
var $logoOffsetTop=$('#header-outer #logo img:visible').position().top;
var $logoMargin=parseInt($('#header-outer #logo img:visible').css('margin-top'));
var $logoWidth=$('#header-outer #logo img:visible').width();
}else{
var $logoOffset=$('#header-outer .span_3 #logo:visible').offset();
var $logoOffsetTop=$('#header-outer .span_3 #logo:visible').offset().top - $(window).scrollTop();
var $logoMargin=parseInt($('#header-outer .span_3 #logo:visible').css('margin-top'));
var $logoWidth=$('#header-outer #logo').width();
}
var $bodyBorderSize=($('.body-border-top').length > 0) ? $('.body-border-top').height():0;
var $containerMargin=parseInt($('#header-outer header > .container').css('padding-left'));
var $headerOffset=$('#header-outer').position();
$(window).on('smartresize', function(){
if($('#header-outer #logo img').length > 0){
$logoMargin=parseInt($('#header-outer #logo img:visible').css('margin-top'));
$logoOffset=$('#header-outer #logo img:visible').position();
$logoOffsetTop=$('#header-outer #logo img:visible').position().top;
$logoWidth=$('#header-outer #logo img:visible').width();
}else{
$logoMargin=parseInt($('#header-outer .span_3 #logo:visible').css('margin-top'));
$logoOffset=$('#header-outer .span_3 #logo:visible').offset();
$logoOffsetTop=$('#header-outer .span_3 #logo:visible').offset().top - $(window).scrollTop();
$logoWidth=$('#header-outer #logo').width();
}
$containerMargin=parseInt($('#header-outer header > .container').css('padding-left'));
$buttonsOffset=($('#social-in-menu').length > 0) ? $('#social-in-menu').position():$('#header-outer header#top nav > ul.buttons').position();
$headerOffset=$('#header-outer').position();
});
$('body').mousemove(function(e){
if($('body.mobile').length==0){
if(e.clientX >=$buttonsOffset.left + $containerMargin &&
e.clientY >=$buttonsOffset.top + $bodyBorderSize &&
e.clientY <=$buttonsOffset.top + $headerOffset.top + $bodyBorderSize + $('#header-outer header#top nav > ul.buttons').height() ||
e.clientX <=$logoOffset.left + $containerMargin + $logoWidth &&
e.clientY >=$logoOffsetTop + $bodyBorderSize&&
e.clientY <=$logoOffsetTop + $logoMargin + $bodyBorderSize + $headerOffset.top + $('#header-outer #logo img:visible').height()){
$('.midnightHeader, #header-outer').removeClass('no-pointer-events');
}else{
$('.midnightHeader, #header-outer').addClass('no-pointer-events');
}}else{
$('.midnightHeader, #header-outer').removeClass('no-pointer-events');
}});
}
else if($('#header-outer[data-has-menu="true"]').length > 0){
var $headerPos=$('header#top .container').position();
var $headerOffset=$('header#top .container').offset();
var $bodyBorderSize=($('.body-border-top').length > 0) ? $('.body-border-top').height():0;
$(window).on('smartresize', function(){
$headerPos=$('header#top .container').position();
$headerOffset=$('header#top .container').offset();
});
$('body').mousemove(function(e){
if($('body.mobile').length==0){
if(e.clientX >=$headerOffset.left &&
e.clientY >=$headerPos.top + $bodyBorderSize &&
e.clientY <=$('header#top .container .row').height() + $bodyBorderSize){
$('.midnightHeader, #header-outer').removeClass('no-pointer-events');
}else if($('li.sfHover').length==0){
$('.midnightHeader, #header-outer').addClass('no-pointer-events');
}}else{
$('.midnightHeader, #header-outer').removeClass('no-pointer-events');
}});
}}
}
function getScrollbarWidth(){
var outer=document.createElement("div");
outer.style.visibility="hidden";
outer.style.width="100px";
outer.style.msOverflowStyle="scrollbar";
document.body.appendChild(outer);
var widthNoScroll=outer.offsetWidth;
outer.style.overflow="scroll";
var inner=document.createElement("div");
inner.style.width="100%";
outer.appendChild(inner);
var widthWithScroll=inner.offsetWidth;
outer.parentNode.removeChild(outer);
return widthNoScroll - widthWithScroll;
}
function boxRollInit(){
if($('.nectar-box-roll').length > 0){
$('body').attr('data-scrollbar-width',getScrollbarWidth());
$('body, html, #ajax-content-wrap, .container-wrap, .blurred-wrap').addClass('no-scroll');
$('body,html').stop().animate({ scrollTop:0 },0);
$('.container-wrap').css('opacity',0).addClass('no-transform-animation-bottom-out').addClass('bottomBoxOut');
if($('.mobile').length==0) $('#ajax-loading-screen .loading-icon > span').css({ 'left':'-'+getScrollbarWidth()/2 +'px'});
var $overlaid=$('#page-header-bg .overlaid-content').clone();
var $scrollDownOverlaid=$('.scroll-down-wrap').clone();
$('#page-header-bg').removeAttr('data-midnight');
$('#page-header-bg .overlaid-content, #page-header-bg .scroll-down-wrap').remove();
$('.nectar-box-roll').append($overlaid).attr('data-midnight','light');
$('.overlaid-content').append($scrollDownOverlaid);
nectarBoxRollContentHeight();
setTimeout(function(){ pageLoadHash(); },700);
}else{
$('#ajax-content-wrap, .blurred-wrap').addClass('at-content');
$('body, html, #ajax-content-wrap, .container-wrap, .blurred-wrap').removeClass('no-scroll');
$('.container-wrap').css('opacity',1).removeClass('no-transform-animation-bottom-out').removeClass('bottomBoxOut').removeClass('bottomBoxIn');
perspect='not-rolled';
}}
boxRollInit();
function nectarBoxRollContentHeight(){
if($('#header-outer[data-transparent-header="true"]').length==0){
$('.nectar-box-roll .overlaid-content, .nectar-box-roll .canvas-bg, .container-wrap').css({'height':window.innerHeight - $('#header-space').height(), 'min-height':window.innerHeight - $('#header-space').height() });
if($('.mobile').length==0){ $('#ajax-content-wrap').css('margin-top',$('#header-space').height()); $('#slide-out-widget-area.fullscreen').css('margin-top','-'+$('#header-space').height()+'px'); }
else $('#ajax-content-wrap, #slide-out-widget-area.fullscreen').css('margin-top','0');
}else{
$('.nectar-box-roll .overlaid-content, .nectar-box-roll .canvas-bg, .container-wrap').css('height',window.innerHeight);
}}
if($('.nectar-box-roll').length > 0) $(window).on('resize',nectarBoxRollContentHeight);
var perspect='not-rolled';
var animating='false';
function boxRoll(e,d){
if($('#slide-out-widget-area.open').length > 0) return false;
if($('.nectar-box-roll canvas').length > 0&&$('.nectar-box-roll canvas[data-loaded="true"]').length==0) return false;
if(perspect=='not-rolled'&&animating=='false'&&d==-1){
perspect='rolled';
animating='true';
$('body').addClass('box-animating').addClass('box-perspective-rolled').addClass('box-rolling');
$('.nectar-box-roll #page-header-bg').removeClass('topBoxIn').addClass('topBoxOut').css('will-change','transform');
$('.nectar-box-roll .overlaid-content').removeClass('topBoxIn2').removeClass('topBoxIn').addClass('topBoxOut2').css('will-change','transform');
$('.container-wrap').removeClass('bottomBoxOut').addClass('bottomBoxIn').removeClass('no-transform-animation-bottom-out').addClass('nectar-box-roll-class').css('will-change','transform');
if($('#header-outer[data-transparent-header="true"]').length==0){
$('.container-wrap').css({'height':$(window).height() - $('#header-space').height(), 'opacity': 1});
$('#slide-out-widget-area.fullscreen').css('margin-top','0px');
}else{
$('.container-wrap').css({'height':$(window).height(), 'opacity': 1});
}
$('.nectar-slider-wrap').css({'opacity':0});
updateRowRightPadding(d);
pauseVideoBG();
var timeout1=1220;
var timeout2=1650;
var timeout3=1700;
var timeout4=1350;
if($('html.no-cssanimations').length > 0){
timeout1=1;
timeout2=1;
timeout3=1;
timeout4=1;
}
$('.container-wrap').css('padding-right',$('body').attr('data-scrollbar-width') + 'px');
setTimeout(function(){
$('#header-outer, #wpadminbar, .cart-outer .cart-menu, .midnightHeader .midnightInner').animate({'padding-right': $('body').attr('data-scrollbar-width')},250);
$('.nectar-box-roll .canvas-bg').addClass('out-of-sight');
if($('#header-outer[data-permanent-transparent="1"]').length==0) $('#header-outer').removeClass('transparent');
if($('body.mobile').length > 0) $('.nectar-box-roll').css({'z-index':'1'});
},timeout1);
setTimeout(function(){
updateRowRightPadding(1);
$('body,html,#ajax-content-wrap, .container-wrap, .blurred-wrap').removeClass('no-scroll');
$('#ajax-content-wrap, .blurred-wrap').addClass('at-content');
$('.container-wrap, #footer-outer').removeClass('bottomBoxIn').removeClass('nectar-box-roll-class').addClass('auto-height');
$('#header-outer, #wpadminbar, .container-wrap, .cart-outer .cart-menu, .midnightHeader .midnightInner').stop().css('padding-right',0);
if($smoothActive==1&&$(window).width() > 690&&Modernizr.csstransforms3d&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
niceScrollInit();
}
$('.nectar-box-roll').css({'z-index':'-1000'}).transition({'y': '-200%'},0);
$('.nectar-box-roll canvas').hide();
$('body').removeClass('box-rolling');
$('.nectar-slider-wrap').transition({'opacity':1},600,'easeOutCubic');
$('.nectar-box-roll #page-header-bg, .nectar-box-roll .overlaid-content, .container-wrap').css('will-change','auto');
if($waypointsBound==false) waypoints();
},timeout2);
setTimeout(function(){
$('.container-wrap .main-content > .row > div > div[class*="col"]').css({'opacity':1});
},timeout4);
setTimeout(function(){
animating='false';
$('body').removeClass('box-animating');
},timeout3);
if($('#header-outer[data-permanent-transparent="1"]').length==0&&$('.mobile').length==0&&$('#header-outer[data-transparent-header="true"]').length!=0){
$('#ajax-content-wrap').transition({'margin-top':$('#header-outer').outerHeight(true) + $('#header-outer').offset().top},2000,'easeInOutQuad');
}
if($('.mobile #header-outer[data-permanent-transparent="1"]').length > 0&&$('.mobile #header-outer[data-mobile-fixed="false"]').length==1) $('#header-outer').transition({'y':'-100%'},400,'easeOutCubic');
}
else if(perspect=='rolled'&&animating=='false'&&d==1&&$(window).scrollTop() < 100){
$('.container-wrap').removeClass('auto-height');
if($('#header-outer[data-transparent-header="true"]').length==0){
$('.container-wrap').css({'height':$(window).height() - $('#header-space').height(), 'opacity': 1});
}else{
$('.container-wrap').css({'height':$(window).height(), 'opacity': 1});
}
$('#footer-outer').removeClass('auto-height');
$('body').addClass('box-rolling');
perspect='not-rolled';
animating='true';
$('body').addClass('box-animating').addClass('box-perspective-not-rolled');
$('#header-outer, #wpadminbar, .container-wrap, .cart-outer .cart-menu, .midnightHeader .midnightInner').css('padding-right',$('body').attr('data-scrollbar-width') + 'px');
$('.nectar-slider-wrap').transition({'opacity':0},600,'easeOutCubic');
$('.container-wrap .main-content > .row > div > div[class*="col"]').stop(true).css({'opacity':0});
setTimeout(function(){
$('#header-outer, #wpadminbar, .cart-outer .cart-menu, .midnightHeader .midnightInner').animate({'padding-right': 0},250);
$('.nectar-box-roll .canvas-bg').removeClass('out-of-sight');
resizeVideoToCover();
if($('#header-outer[data-transparent-header="true"]').length!=0){
$('#ajax-content-wrap').stop(true,true).transition({'margin-top':0},2000,'easeInOutCubic');
}else{
if($('.mobile').length==0) $('#slide-out-widget-area.fullscreen').css('margin-top','-'+$('#header-space').height()+'px');
}},30);
var timeout1=1700;
var timeout2=1600;
var timeout3=1300;
if($('html.no-cssanimations').length > 0){
timeout1=1;
timeout2=1;
timeout3=1;
}
if($('body.mobile').length > 0){
setTimeout(function(){
$('.nectar-box-roll').css('z-index','1000');
},timeout3);
}else{
$('.nectar-box-roll').css('z-index','1000');
}
updateRowRightPadding(d);
removeNiceScroll();
$('.nectar-box-roll').transition({'y': '0'},0);
$('.nectar-box-roll canvas').show();
setTimeout(function(){
updateRowRightPadding(1);
animating='false';
$('body').removeClass('box-animating');
$('#page-header-bg').removeClass('topBoxIn');
$('.overlaid-content').removeClass('topBoxIn2');
$('body').removeClass('box-rolling');
resumeVideoBG();
$('.nectar-box-roll #page-header-bg, .nectar-box-roll .overlaid-content, .container-wrap').css('will-change','auto');
},timeout1);
setTimeout(function(){
if($('.mobile #header-outer[data-permanent-transparent="1"]').length > 0&&$('.mobile #header-outer[data-mobile-fixed="false"]').length==1) $('#header-outer').transition({'y':'0%'},400,'easeOutCubic');
},timeout2);
$('body,html,#ajax-content-wrap, .container-wrap, .blurred-wrap').addClass('no-scroll');
$('#ajax-content-wrap, .blurred-wrap').removeClass('at-content');
$('.container-wrap').addClass('nectar-box-roll-class');
$('.nectar-box-roll #page-header-bg').removeClass('topBoxOut').addClass('topBoxIn').css('will-change','transform');
$('.container-wrap').removeClass('bottomBoxIn').addClass('bottomBoxOut').css('will-change','transform');
if($('#header-outer[data-transparent-header="true"]').length > 0&&$('#header-outer[data-permanent-transparent="1"]').length==0) $('#header-outer').addClass('transparent');
$('.nectar-box-roll .overlaid-content').removeClass('topBoxOut2').removeClass('topBoxOut').addClass('topBoxIn2').css('will-change','transform');
if($('#header-outer[data-header-resize="1"]').length > 0){ bigNav(); }
$('.nectar-box-roll .trigger-scroll-down').removeClass('hovered');
}}
function boxScrollEvent(event, delta){
if($('#slide-out-widget-area.open.fullscreen').length > 0) return false;
boxRoll(event,delta);
}
function boxRollMouseWheelInit(){
if($('.nectar-box-roll').length > 0){
$('body').on("mousewheel", boxScrollEvent);
}else{
$('body').off("mousewheel", boxScrollEvent);
}}
boxRollMouseWheelInit();
$('body').on('click','.nectar-box-roll .section-down-arrow',function(){
boxRoll(null,-1);
$(this).addClass('hovered');
setTimeout(function(){ $('.nectar-box-roll .section-down-arrow').removeClass('hovered'); },2000);
return false;
});
function updateRowRightPadding(d){
$('.wpb_row.full-width-section').each(function(){
if($(this).hasClass('extraPadding')&&d==1){
$(this).css('padding-right',parseInt($(this).css('padding-right')) - parseInt($('body').attr('data-scrollbar-width')) + 'px').removeClass('extraPadding');
}else{
$(this).css('padding-right',parseInt($('body').attr('data-scrollbar-width')) + parseInt($(this).css('padding-right')) + 'px').addClass('extraPadding');
}});
$('.wpb_row.full-width-content').each(function(){
if($(this).find('.row-bg.using-image').length==0){
if($(this).hasClass('extraPadding')&&d==1){
$(this).find('.row-bg').css('width',parseInt($(this).width()) - parseInt($('body').attr('data-scrollbar-width')) + 'px').removeClass('extraPadding');
}else{
$(this).find('.row-bg').css('width',parseInt($('body').attr('data-scrollbar-width')) + $(this).width() + 'px').addClass('extraPadding');
}}
});
}
function pauseVideoBG(){
if($('.nectar-box-roll video').length > 0) $('.nectar-box-roll video')[0].pause();
}
function resumeVideoBG(){
if($('.nectar-box-roll video').length > 0) $('.nectar-box-roll video')[0].play();
}
if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)&&$('.nectar-box-roll').length > 0){
$('body').swipe({
swipeStatus: function(event, phase, direction, distance, duration, fingers){
if($('#slide-out-widget-area.open').length > 0) return false;
if(direction=='up'){
boxRoll(null,-1);
if($('#ajax-content-wrap.no-scroll').length==0) $('body').swipe("option", "allowPageScroll", 'vertical');
}else if(direction=="down"&&$(window).scrollTop()==0){
boxRoll(null,1);
$('body').swipe("option", "allowPageScroll", 'auto');
}}
});
}
function removeNiceScroll(){
if($().niceScroll&&$("html").getNiceScroll()){
var nice=$("html").getNiceScroll();
nice.stop();
$('html').removeClass('no-overflow-y');
$('.nicescroll-rails').hide();
if($('#boxed').length==0){
$('body, body #header-outer, body #header-secondary-outer, body #search-outer, .midnightHeader .midnightInner').css('padding-right','0px');
}else if($('body[data-ext-responsive="true"]').length==0){
$('body').css('padding-right','0px');
}
$('body').attr('data-smooth-scrolling','0');
}}
$waypointsBound=false;
function waypoints(){
colAndImgAnimations();
progressBars();
dividers();
iconList();
animated_titles();
imageWithHotspots();
clientsFadeIn();
splitLineHeadings();
svgAnimations();
milestoneInit();
nectar_fancy_ul_init();
owl_carousel_animate();
headerRowColorInheritInit();
morphingOutlines();
$waypointsBound=true;
}
var timeout;
var productToAdd;
$('body').on('click','.product .add_to_cart_button', function(){
productToAdd=$(this).parents('li').find('h3').text();
$('#header-outer .cart-notification span.item-name').html(productToAdd);
});
$('body').on('mouseenter','#header-outer .cart-notification',function(){
$(this).fadeOut(400);
$('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(300);
$('#header-outer .cart_list').stop(true,true).fadeIn(300);
clearTimeout(timeout);
});
$('#header-outer div.cart-outer').hoverIntent(function(){
$('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(300);
$('#header-outer .cart_list').stop(true,true).fadeIn(300);
clearTimeout(timeout);
$('#header-outer .cart-notification').fadeOut(300);
});
$('body').on('mouseleave','#header-outer div.cart-outer',function(){
var $that=$(this);
setTimeout(function(){
if(!$that.is(':hover')){
$('#header-outer .widget_shopping_cart').stop(true,true).fadeOut(300);
$('#header-outer .cart_list').stop(true,true).fadeOut(300);
}},100);
});
if($('#header-outer[data-cart="false"]').length==0){
$('body').on('added_to_cart', shopping_cart_dropdown_show);
$('body').on('added_to_cart', shopping_cart_dropdown);
}
function shopping_cart_dropdown(){
if(!$('.widget_shopping_cart .widget_shopping_cart_content .cart_list .empty').length&&$('.widget_shopping_cart .widget_shopping_cart_content .cart_list').length > 0){
$('.cart-menu-wrap').addClass('has_products');
$('header#top nav > ul, #search-outer #search #close a').addClass('product_added');
if(!$('.cart-menu-wrap').hasClass('static')) $('.cart-menu-wrap').addClass('first-load');
if($('#header-outer').hasClass('directional-nav-effect')&&$('#header-outer .cart-icon-wrap .dark').length==0&&$('body.ascend').length > 0){
$('#header-outer .cart-outer .cart-icon-wrap').each(function(){
$(this).find('> i, > span.light, > span.dark, > span.original').remove();
$(this).append('');
$(this).find('.original').attr('data-w',$(this).find('span.original').width()+1);
});
}}
}
function shopping_cart_dropdown_show(e){
clearTimeout(timeout);
if(!$('.widget_shopping_cart .widget_shopping_cart_content .cart_list .empty').length&&$('.widget_shopping_cart .widget_shopping_cart_content .cart_list').length > 0&&typeof e.type!='undefined'){
if(!$('#header-outer .cart-menu-wrap').hasClass('has_products')){
setTimeout(function(){ $('#header-outer .cart-notification').fadeIn(400); },400);
}
else if(!$('#header-outer .cart-notification').is(':visible')){
$('#header-outer .cart-notification').fadeIn(400);
}else{
$('#header-outer .cart-notification').show();
}
timeout=setTimeout(hideCart,2700);
$('.cart-menu a, .widget_shopping_cart a').addClass('no-ajaxy');
}}
function hideCart(){
$('#header-outer .cart-notification').stop(true,true).fadeOut();
}
function checkForWooItems(){
var checkForCartItems=setInterval(shopping_cart_dropdown,250);
setTimeout(function(){ clearInterval(checkForCartItems); },4500);
}
if($('#header-outer[data-cart="false"]').length==0){
checkForWooItems();
}
var extraHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
var secondaryHeader=($('#header-outer').attr('data-using-secondary')=='1') ? 32:0 ;
function searchFieldCenter(){
$('#search-outer').css('top',$('#header-outer').outerHeight() + extraHeight + secondaryHeader);
$('#search-outer > #search #search-box').css('top',($(window).height()/2) - ($('#search-outer > #search input').height()/2) - $('#header-outer').outerHeight());
}
$('body').on('mouseover','.text_on_hover .product-wrap',function(){
$(this).parent().addClass('hovered');
});
$('body').on('mouseover','.text_on_hover > a:first-child',function(){
$(this).parent().addClass('hovered');
});
$('body').on('mouseout','.text_on_hover .product-wrap',function(){
$(this).parent().removeClass('hovered');
});
$('body').on('mouseout','.text_on_hover > a:first-child',function(){
$(this).parent().removeClass('hovered');
});
/*
$('.text_on_hover.product .star-rating span').each(function(){
$(this).attr('data-width',$(this).width());
$(this).css('width', $(this).attr('data-width') - 40);
});*/
var $placeholder=$('#search input[type=text]').attr('data-placeholder');
var logoHeight=parseInt($('#header-outer').attr('data-logo-height'));
$('body').on('click', '#search-btn a', function(){ return false; });
$('body').on('mousedown', '#search-btn a:not(.inactive)', function(){
if($(this).hasClass('open-search')){ return false; }
if($('body').hasClass('ascend')){
$('#search-outer > #search form, #search-outer #search .span_12 span').css('opacity',0);
$('#search-outer > #search form').css('bottom','10px');
$('#search-outer #search .span_12 span').css('top','10px');
$('#search-outer').show();
$('#search-outer').stop().transition({scale: '1,0', 'opacity': 1},0).transition({ scale: '1,1'},400,'easeInOutCubic');
$('#search-outer > #search form').delay(400).animate({'opacity':1, 'bottom':0},'easeOutCirc');
$('#search-outer #search .span_12 span').delay(470).animate({'opacity':1, 'top':0},'easeOutCirc');
}else{
$('#search-outer').stop(true).fadeIn(600,'easeOutExpo');
}
$('body:not(.ascend) #search-outer > #search input[type="text"]').css({
'top':$('#search-outer').height()/2 - $('#search-outer > #search input[type="text"]').height()/2
});
setTimeout(function(){
$('#search input[type=text]').focus();
if($('#search input[type=text]').attr('value')==$placeholder){
$('#search input[type=text]').setCursorPosition(0);
}},300);
if($('body').hasClass('ascend')){
searchFieldCenter();
}
$(this).toggleClass('open-search');
$('.slide-out-widget-area-toggle a.open:not(.animating)').trigger('click');
return false;
});
$('body').on('keydown','#search input[type=text]',function(){
if($(this).attr('value')==$placeholder){
$(this).attr('value', '');
}});
$('body').on('keyup','#search input[type=text]',function(){
if($(this).attr('value')==''){
$(this).attr('value', $placeholder);
$(this).setCursorPosition(0);
}});
$('body').on('click','#close',function(){
closeSearch();
$('#search-btn a').removeClass('open-search');
return false;
});
$('body').on('blur','#search-box input[type=text]',function(e){
closeSearch();
$('#search-btn a').removeClass('open-search');
});
function closeSearch(){
if($('body').hasClass('ascend')){
$('#search-outer').stop().transition({'opacity' :0},300,'easeOutCubic');
$('#search-btn a').addClass('inactive');
setTimeout(function(){ $('#search-outer').hide(); $('#search-btn a').removeClass('inactive'); },300);
}else{
$('#search-outer').stop(true).fadeOut(450,'easeOutExpo');
}}
$('body').on('click', '#mobile-menu #mobile-search .container a#show-search',function(){
$('#mobile-menu .container > ul').slideUp(500);
return false;
});
function centeredLogoMargins(){
if($('#header-outer[data-format="centered-logo-between-menu"]').length > 0&&$(window).width() > 1000){
$midnightSelector=($('#header-outer .midnightHeader').length > 0) ? '> .midnightHeader:first-child':'';
var $navItemLength=$('#header-outer[data-format="centered-logo-between-menu"] '+$midnightSelector+' nav > .sf-menu > li').length;
if($('#header-outer #social-in-menu').length > 0) $navItemLength--;
$centerLogoWidth=($('#header-outer .row .col.span_3 #logo img:visible').length==0) ? parseInt($('#header-outer .row .col.span_3').width()):parseInt($('#header-outer .row .col.span_3 img:visible').width());
$('#header-outer[data-format="centered-logo-between-menu"] nav > .sf-menu > li:nth-child('+Math.floor($navItemLength/2)+')').css({'margin-right': ($centerLogoWidth+40) + 'px'}).addClass('menu-item-with-margin');
$leftMenuWidth=0;
$rightMenuWidth=0;
$('#header-outer[data-format="centered-logo-between-menu"] '+$midnightSelector+' nav > .sf-menu > li:not(#social-in-menu)').each(function(i){
if(i+1 <=Math.floor($navItemLength/2)){
$leftMenuWidth +=$(this).width();
}else{
$rightMenuWidth +=$(this).width();
}});
$menuDiff=Math.abs($rightMenuWidth - $leftMenuWidth);
if($leftMenuWidth > $rightMenuWidth)
$('#header-outer .row > .col.span_9').css('padding-right',$menuDiff);
else
$('#header-outer .row > .col.span_9').css('padding-left',$menuDiff);
$('#header-outer[data-format="centered-logo-between-menu"] nav').css('visibility','visible');
}}
var logoHeight=parseInt($('#header-outer').attr('data-logo-height'));
var headerPadding=parseInt($('#header-outer').attr('data-padding'));
var usingLogoImage=$('#header-outer').attr('data-using-logo');
if(isNaN(headerPadding)||headerPadding.length==0){ headerPadding=28; }
if(isNaN(logoHeight)||usingLogoImage.length==0){ usingLogoImage=false; logoHeight=30;}
function headerInit(){
$('#header-outer #logo img').css({
'height':logoHeight,
});
$('#header-outer').css({
'padding-top':headerPadding
});
if($('body.mobile').length==0){
$('header#top nav > ul > li:not(#social-in-menu) > a').css({
'padding-bottom':Math.floor(((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding),
'padding-top':Math.floor((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2))
});
$('header#top nav > ul > li#social-in-menu > a').css({
'margin-bottom':Math.floor(((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding),
'margin-top':Math.floor((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2))
});
}
if($('#header-outer[data-format="centered-menu-under-logo"]').length==0){
$('#header-outer .cart-menu').css({
'padding-bottom':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding),
'padding-top':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding)
});
}else{
$('#header-outer .cart-menu').css({
'padding-bottom':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding + logoHeight/2 + 7),
'padding-top':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding + logoHeight/2 + 7)
});
}
$('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').css({
'padding-bottom':(logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2),
'padding-top':(logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2)
});
$('.slide-out-hover-icon-effect a').css({
'padding-top':headerPadding
});
if($('body.ascend ').length > 0&&$('#header-outer[data-full-width="true"]').length > 0){
$('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').css({
'padding-top': 0,
'padding-bottom': 0
});
$('header#top nav > ul.buttons').css({
'margin-top':- headerPadding,
'height':Math.floor(logoHeight + headerPadding*2) -1
});
$('header#top nav > ul li#search-btn a, header#top nav > ul li.slide-out-widget-area-toggle a, .slide-out-hover-icon-effect a').css({
'visibility':'visible',
'padding-top': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding),
'padding-bottom': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding)
});
}
$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').css({
'top':$('header#top nav > ul > li > a').outerHeight()
});
setTimeout(function(){
$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').css({
'top': parseInt($('#header-outer').outerHeight())+'px'
});
},1000);
$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').css({
'top': parseInt($('#header-outer').outerHeight())+'px'
});
if($('.nectar-parallax-scene.first-section').length==0){
if($('#header-outer').attr('data-using-secondary')=='1'){
if($('#header-outer[data-mobile-fixed="false"]').length > 0||$('body.mobile').length==0){
$('#header-space').css('height', parseInt($('#header-outer').outerHeight()) + $('#header-secondary-outer').height());
}else{
$('#header-space').css('height', parseInt($('#header-outer').outerHeight()));
}}else{
$('#header-space').css('height', $('#header-outer').outerHeight());
}}
$('#header-outer .container, #header-outer .cart-menu').css('visibility','visible');
centeredLogoMargins();
if($('#header-outer[data-format="centered-menu-under-logo"]').length==0){
$('body:not(.ascend) #search-outer, #search .container').css({
'height':logoHeight + headerPadding*2
});
$('body:not(.ascend) #search-outer > #search input[type="text"]').css({
'font-size':43,
'height':'59px',
'top':((logoHeight + headerPadding*2)/2) - $('#search-outer > #search input[type="text"]').height()/2
});
$('body:not(.ascend) #search-outer > #search #close a').css({
'top':((logoHeight + headerPadding*2)/2) - 8
});
}else{
$('body:not(.ascend) #search-outer, #search .container').css({
'height':logoHeight + headerPadding*2 + logoHeight + 17
});
$('body:not(.ascend) #search-outer > #search input[type="text"]').css({
'font-size':43,
'height':'59px',
'top':((logoHeight + headerPadding*2)/2) - ($('#search-outer > #search input[type="text"]').height()/2) + logoHeight/2 + 17
});
$('body:not(.ascend) #search-outer > #search #close a').css({
'top':((logoHeight + headerPadding*2)/2) - 8 + logoHeight/2 + 17
});
}}
$(window).load(function(){
if($(window).scrollTop()==0) headerSpace();
});
var headerResize=$('#header-outer').attr('data-header-resize');
var headerHideUntilNeeded=$('body').attr('data-hhun');
if($(window).scrollTop()!=0&&$('#header-outer.transparent[data-permanent-transparent="false"]').length==1) $('#header-outer').removeClass('transparent');
if(headerResize==1&&headerHideUntilNeeded!='1'){
headerInit();
$(window).off('scroll.headerResizeEffect');
if($('#nectar_fullscreen_rows').length==0)
$(window).on('scroll.headerResizeEffect',smallNav);
}else if(headerHideUntilNeeded!='1'){
headerInit();
$(window).off('scroll.headerResizeEffectOpaque');
$(window).on('scroll.headerResizeEffectOpaque',opaqueCheck);
}else if(headerHideUntilNeeded=='1'){
headerInit();
if($('.nectar-box-roll').length > 0) $('#header-outer').addClass('at-top-before-box');
var previousScroll=0,
menuOffset=$('#header-space').height()*2,
detachPoint=($('body.mobile').length > 0) ? 150:600,
hideShowOffset=6;
function hhunCalcs(e){
if($('body.animated-scrolling').length > 0&&$('#header-outer.detached').length > 0) return false;
if($('#header-outer[data-mobile-fixed="false"]').length > 0&&$('body.mobile').length > 0){ $('#header-outer').removeClass('detached'); return false; }
var currentScroll=$(this).scrollTop(),
scrollDifference=Math.abs(currentScroll - previousScroll);
if(!$('#header-outer').hasClass('side-widget-open')&&!$('#header-outer .slide-out-widget-area-toggle a').hasClass('animating')){
if(currentScroll > menuOffset){
if(currentScroll > detachPoint){
if(!$('#header-outer').hasClass('detached'))
$('#header-outer').addClass('detached').removeClass('parallax-contained');
if($('#header-outer[data-permanent-transparent="1"]').length==0) $('#header-outer').removeClass('transparent');
}
if(scrollDifference >=hideShowOffset){
if(currentScroll > previousScroll){
if(!$('#header-outer').hasClass('invisible'))
$('#header-outer').addClass('invisible').removeClass('at-top');
$('.page-submenu.stuck').css('transform','translateY(0px)').addClass('header-not-visible');
}else{
if($('#header-outer').hasClass('invisible'))
$('#header-outer').removeClass('invisible');
$('.page-submenu.stuck').css('transform','translateY('+$('#header-outer').outerHeight()+'px)').removeClass('header-not-visible');
}}
}else{
$topDetachNum=($('#header-outer[data-using-secondary="1"]').length > 0) ? 32:0;
if($('.body-border-top').length > 0){
$topDetachNum=($('#header-outer[data-using-secondary="1"]').length > 0) ? 32 + $('.body-border-top').height():$('.body-border-top').height();
}
if(currentScroll <=$topDetachNum){
$('#header-outer').removeClass('detached').addClass('at-top');
if($('#header-outer[data-transparent-header="true"]').length > 0&&$('.nectar-box-roll').length==0) $('#header-outer').addClass('transparent').css('transform','translateY(0)');
else if($('.nectar-box-roll').length > 0) $('#header-outer').css('transform','translateY(0)').addClass('at-top-before-box');
if($('.parallax_slider_outer').length > 0||$('#page-header-bg[data-parallax="1"]').length > 0) $('#header-outer').addClass('parallax-contained').css('transform','translateY(0)');
}}
if((window.innerHeight + window.scrollY) >=document.body.offsetHeight){
$('#header-outer').removeClass('invisible');
$('.page-submenu.stuck').css('transform','translateY('+$('#header-outer').outerHeight()+'px)').removeClass('header-not-visible');
}}
previousScroll=currentScroll;
}
hhunCalcs();
$(window).scroll(hhunCalcs);
}
if($('#nectar_fullscreen_rows').length==0) midnightInit();
else ($('#header-outer').attr('data-permanent-transparent','false'))
var shrinkNum=6;
var extraHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
var $bodyBorderHeaderColorMatch=($('.body-border-top').css('background-color')=='#ffffff'&&$('body').attr('data-header-color')=='light'||$('.body-border-top').css('background-color')==$('#header-outer').attr('data-user-set-bg')) ? true:false;
if($('#header-outer[data-shrink-num]').length > 0) shrinkNum=$('#header-outer').attr('data-shrink-num');
function smallNav(){
var $offset=$(window).scrollTop();
var $windowWidth=$(window).width();
if($offset > 0&&$windowWidth > 1000){
if($('#header-outer').attr('data-transparent-header')=='true'&&$('#header-outer.side-widget-open').length==0&&$('#header-outer[data-permanent-transparent="1"]').length==0) $('#header-outer').removeClass('transparent');
$('.ns-loading-cover').hide();
$('#header-outer, #search-outer').addClass('small-nav');
$('#header-outer #logo img').stop(true,true).animate({
'height':logoHeight - shrinkNum
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('#header-outer').stop(true,true).animate({
'padding-top':Math.ceil(headerPadding / 1.8)
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('header#top nav > ul > li:not(#social-in-menu) > a').stop(true,true).animate({
'padding-bottom':Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding / 1.8) ,
'padding-top':Math.floor(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2))
},{queue:false, duration:250, easing: 'easeOutCubic'});
if($('#header-outer[data-full-width="true"][data-transparent-header="true"]').length > 0&&$('.body-border-top').length > 0&&$bodyBorderHeaderColorMatch==true){
$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
'padding':'0'
},{queue:false, duration:250, easing: 'easeOutCubic'});
}
$('header#top nav > ul > li#social-in-menu > a').stop(true,true).animate({
'margin-bottom':Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding / 1.8) ,
'margin-top':Math.floor(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2))
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('header#top nav > ul > li.menu-item-with-margin').stop(true,true).animate({
'margin-right': (parseInt($('header#top nav > ul > li.menu-item-with-margin').css('margin-right')) - parseInt(shrinkNum)*4) +'px'
},{queue:false, duration:250, easing: 'easeOutCubic'});
if($bodyBorderHeaderColorMatch==true){
$('.body-border-top').stop(true,true).animate({
'margin-top': '-'+$('.body-border-top').height()+'px'
},{queue:false, duration:400, easing: 'easeOutCubic', complete: function(){ $(this).css('margin-top',0)}});
}
if($('#header-outer[data-format="centered-menu-under-logo"]').length==0){
$('#header-outer .cart-menu').stop(true,true).animate({
'padding-top':Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7),
'padding-bottom':Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7) +1
},{queue:false, duration:250, easing: 'easeOutCubic'});
}else{
$('#header-outer .cart-menu').stop(true,true).animate({
'padding-bottom':Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding / 1.7) + (logoHeight-shrinkNum)/2 + 9,
'padding-top':Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding / 1.7) + (logoHeight-shrinkNum)/2 + 9
},{queue:false, duration:250, easing: 'easeOutCubic'});
}
if($('body.ascend ').length > 0&&$('#header-outer[data-full-width="true"]').length > 0){
$('header#top nav > ul.buttons').stop(true,true).animate({
'margin-top':- Math.ceil(headerPadding/ 1.8),
'height':Math.floor((headerPadding*2)/ 1.8 + logoHeight-shrinkNum)
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('header#top nav > ul li#search-btn a, header#top nav > ul li.slide-out-widget-area-toggle a').stop(true,true).animate({
'padding-top':Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7),
'padding-bottom':Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7) +1
},{queue:false, duration:250, easing: 'easeOutCubic'});
}else{
$('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').stop(true,true).animate({
'padding-bottom':Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2)),
'padding-top':Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2))
},{queue:false, duration:250, easing: 'easeOutCubic'});
}
$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
'top':Math.floor($('header#top nav > ul > li > a').height() + (((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2))*2 + headerPadding / 1.8),
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').stop(true,true).animate({
'top': Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8) +'px'
},{queue:false, duration:250, easing: 'easeOutCubic'});
if($('#header-outer[data-format="centered-menu-under-logo"]').length==0){
$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
'height':Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8)
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
'font-size':30,
'line-height':'30px',
'height':'44px',
'top':((logoHeight-shrinkNum+headerPadding+5)/2) - ($('#search-outer > #search input[type="text"]').height()-15)/2
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
'top':((logoHeight-shrinkNum + headerPadding+5)/2) - 10
},{queue:false, duration:250, easing: 'easeOutCubic'});
}else{
$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
'height':Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8) + logoHeight - shrinkNum + 17
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
'font-size':30,
'line-height':'30px',
'height':'44px',
'top':((logoHeight-shrinkNum+headerPadding+5)/2) - ($('#search-outer > #search input[type="text"]').height()-15)/2 + (logoHeight- shrinkNum)/2 + 8
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
'top':((logoHeight-shrinkNum + headerPadding+5)/2) - 10 + (logoHeight- shrinkNum)/2 + 8
},{queue:false, duration:250, easing: 'easeOutCubic'});
}
if($('.nectar-box-roll').length > 0&&$('#header-outer[data-permanent-transparent="1"]').length==0) $('#ajax-content-wrap').animate({'margin-top': (Math.floor((logoHeight-shrinkNum) +(headerPadding*2)/ 1.8 + extraHeight + secondaryHeader)) },{queue:false, duration:250, easing: 'easeOutCubic'})
if($('body').hasClass('ascend')){
$('#search-outer').stop(true,true).animate({
'top':Math.floor((logoHeight-shrinkNum) +(headerPadding*2)/ 1.8 + extraHeight + secondaryHeader)
},{queue:false, duration:250, easing: 'easeOutCubic'});
}
if(usingLogoImage==false) $('header#top #logo').stop(true,true).animate({
'margin-top':0
},{queue:false, duration:450, easing: 'easeOutExpo'});
$(window).off('scroll',smallNav);
$(window).on('scroll',bigNav);
$('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease, margin 0.25s ease-out');
$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','none');
setTimeout(function(){
$('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease, border-color 0.40s ease, margin 0.25s ease-out');
$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','border-color 0.40s ease');
},300);
}}
function bigNav(){
var $offset=$(window).scrollTop();
var $windowWidth=$(window).width();
if($offset==0&&$windowWidth > 1000||$('.small-nav').length > 0&&$('#ajax-content-wrap.no-scroll').length > 0||$('.small-nav').length > 0&&$('.slide-out-from-right-hover.open').length > 0||$('.small-nav').length > 0&&$('.slide-out-from-right.open').length > 0&&$bodyBorderHeaderColorMatch==true){
$('#header-outer, #search-outer').removeClass('small-nav');
if($('#header-outer').attr('data-transparent-header')=='true'&&$('.nectar-box-roll').length==0) $('#header-outer').addClass('transparent');
$('.ns-loading-cover').show();
$('#header-outer #logo img').stop(true,true).animate({
'height':logoHeight,
},{queue:false, duration:250, easing: 'easeOutCubic'});
if($('#header-outer[data-full-width="true"][data-transparent-header="true"]').length > 0&&$('.body-border-top').length > 0&&$bodyBorderHeaderColorMatch==true){
$('#header-outer[data-full-width="true"] header > .container').stop(true,true).animate({
'padding':'0 28px'
},{queue:false, duration:250, easing: 'easeOutCubic'});
}
$('#header-outer').stop(true,true).animate({
'padding-top':headerPadding
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('header#top nav > ul > li:not(#social-in-menu) > a').stop(true,true).animate({
'padding-bottom':((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding,
'padding-top':(logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('header#top nav > ul > li#social-in-menu > a').stop(true,true).animate({
'margin-bottom':((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding,
'margin-top':(logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('header#top nav > ul > li.menu-item-with-margin').stop(true,true).animate({
'margin-right': (parseInt($('header#top nav > ul > li.menu-item-with-margin').css('margin-right')) + parseInt(shrinkNum)*4) +'px'
},{queue:false, duration:250, easing: 'easeOutCubic'});
if($bodyBorderHeaderColorMatch==true){
$('.body-border-top').css({ 'margin-top': '-'+$('.body-border-top').height()+'px'}).stop(true,true).animate({
'margin-top': '0'
},{queue:false, duration:250, easing: 'easeOutCubic'});
}
if($('#header-outer[data-format="centered-menu-under-logo"]').length==0){
$('#header-outer .cart-menu').stop(true,true).animate({
'padding-bottom':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding),
'padding-top':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding)
},{queue:false, duration:250, easing: 'easeOutCubic'});
}else{
$('#header-outer .cart-menu').stop(true,true).animate({
'padding-bottom':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding) + logoHeight/2 + 7,
'padding-top':Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding) + logoHeight/2 + 7
},{queue:false, duration:250, easing: 'easeOutCubic'});
}
if($('body.ascend ').length > 0&&$('#header-outer[data-full-width="true"]').length > 0){
$('header#top nav > ul.buttons').stop(true,true).animate({
'margin-top':- Math.ceil(headerPadding),
'height':Math.floor(headerPadding*2 + logoHeight) -1
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('header#top nav > ul li#search-btn a, header#top nav > ul li.slide-out-widget-area-toggle a').stop(true,true).animate({
'padding-top': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding),
'padding-bottom': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding)
},{queue:false, duration:250, easing: 'easeOutCubic'});
}else{
$('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').stop(true,true).animate({
'padding-bottom':Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2)),
'padding-top':Math.ceil((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2))
},{queue:false, duration:250, easing: 'easeOutCubic'});
}
$('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({
'top':Math.ceil($('header#top nav > ul > li > a').height() + (((logoHeight)/2) - ($('header#top nav > ul > li > a').height()/2))*2 + headerPadding),
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer #search-box .ui-autocomplete').stop(true,true).animate({
'top': Math.ceil(logoHeight + headerPadding*2) +'px'
},{queue:false, duration:250, easing: 'easeOutCubic'});
if($('#header-outer[data-format="centered-menu-under-logo"]').length==0){
$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
'height':Math.ceil(logoHeight + headerPadding*2)
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
'font-size':43,
'line-height':'43px',
'height':'59px',
'top':((logoHeight + headerPadding*2)/2) - 30
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
'top':((logoHeight + headerPadding*2)/2) - 8
},{queue:false, duration:250, easing: 'easeOutCubic'});
}else{
$('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
'height':Math.ceil(logoHeight + headerPadding*2) + logoHeight + 17
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({
'font-size':43,
'line-height':'43px',
'height':'59px',
'top':((logoHeight + headerPadding*2)/2) - 30 + (logoHeight)/2 + 8
},{queue:false, duration:250, easing: 'easeOutCubic'});
$('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({
'top':((logoHeight + headerPadding*2)/2) - 8 + (logoHeight)/2 + 8
},{queue:false, duration:250, easing: 'easeOutCubic'});
}
if($('body').hasClass('ascend')){
$('#search-outer').stop(true,true).animate({
'top':(logoHeight) +(headerPadding*2) + extraHeight + secondaryHeader
},{queue:false, duration:250, easing: 'easeOutCubic'});
}
if(usingLogoImage==false) $('header#top #logo').stop(true,true).animate({
'margin-top':4
},{queue:false, duration:450, easing: 'easeOutExpo'});
if($('.nectar-box-roll').length > 0&&$('#header-outer[data-permanent-transparent="1"]').length==0) $('#ajax-content-wrap').animate({'margin-top': (Math.floor((logoHeight) +(headerPadding*2) + extraHeight + secondaryHeader)) },{queue:false, duration:250, easing: 'easeOutCubic'})
$(window).off('scroll',bigNav);
$(window).on('scroll',smallNav);
$('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease, margin 0.25s ease-out');
$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','none');
setTimeout(function(){
$('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease, border-color 0.40s ease, margin 0.25s ease-out');
$('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','border-color 0.40s ease');
},300);
}}
function headerSpace(){
if($('.mobile').length > 0){
if(window.innerHeight < window.innerWidth&&window.innerWidth > 1000){
if($('#header-outer.small-nav').length==0)
$('#header-space').css('height', $('#header-outer').outerHeight() + $('#header-secondary-outer').height());
}else{
$('#header-space').css('height', $('#header-outer').outerHeight());
}}else{
if($('.nectar-parallax-scene.first-section').length==0){
var shrinkNum=6;
var headerPadding=parseInt($('#header-outer').attr('data-padding'));
if($('#header-outer[data-shrink-num]').length > 0) shrinkNum=$('#header-outer').attr('data-shrink-num');
var headerPadding2=headerPadding - headerPadding/1.8;
var $headerHeight=($('#header-outer[data-header-resize="1"]').length > 0&&$('.small-nav').length > 0) ? $('#header-outer').outerHeight() + (parseInt(shrinkNum) + headerPadding2*2):$('#header-outer').outerHeight();
if($('#header-outer').attr('data-using-secondary')=='1'){
$('#header-space').css('height', $headerHeight + $('#header-secondary-outer').height());
}else{
$('#header-space').css('height', $headerHeight);
}}
}}
var lastPosition=-1;
function headerOffsetAdjust(){
var $scrollTop=$(window).scrollTop();
if(lastPosition==$scrollTop){
requestAnimationFrame(headerOffsetAdjust);
return false;
} else lastPosition=$scrollTop;
headerOffsetAdjustCalc();
requestAnimationFrame(headerOffsetAdjust);
}
function headerOffsetAdjustCalc(){
if($('body.mobile').length > 0){
var $eleHeight=0;
var $endOffset=($('#wpadminbar').css('position')=='fixed') ? $('#wpadminbar').height():0;
if($('#header-secondary-outer').length > 0) $eleHeight +=$('#header-secondary-outer').height();
if($('#wpadminbar').length > 0) $eleHeight +=$('#wpadminbar').height();
if($eleHeight - $scrollTop > $endOffset){
$('#header-outer').css('top', $eleHeight - $scrollTop + 'px');
}else{ $('#header-outer').css('top', $endOffset); }}else{
var $eleHeight=0;
if($('#header-secondary-outer').length > 0) $eleHeight +=$('#header-secondary-outer').height();
if($('#wpadminbar').length > 0) $eleHeight +=$('#wpadminbar').height();
$('#header-outer').css('top',$eleHeight+'px');
}}
if($('#header-outer[data-mobile-fixed="1"]').length > 0&&$('#wpadminbar').length > 0||$('#header-outer[data-mobile-fixed="1"]').length > 0&&$('#header-secondary-outer').length > 0){
if($('#nectar_fullscreen_rows').length==0) requestAnimationFrame(headerOffsetAdjust);
$(window).smartresize(headerOffsetAdjustCalc);
}
function footerRevealCalcs(){
if($(window).height() - $('#wpadminbar').height() - $('#header-outer').outerHeight() - $('#footer-outer').height() - 1 -$('#page-header-bg').height() -$('.parallax_slider_outer').height() - $('.page-header-no-bg').height() > 0){
$resizeExtra=($('#header-outer[data-header-resize="1"]').length > 0) ? 55: 0;
$('.container-wrap').css({'margin-bottom': $('#footer-outer').height()-1, 'min-height': $(window).height() - $('#wpadminbar').height() - $('#header-outer').outerHeight() - $('#footer-outer').height() -1 - $('.page-header-no-bg').height() -$('#page-header-bg').height() -$('.parallax_slider_outer').height() + $resizeExtra });
}else{
$('.container-wrap').css({'margin-bottom': $('#footer-outer').height()-1 });
}
if($(window).width() < 1000) $('#footer-outer').attr('data-midnight','light');
else $('#footer-outer').removeAttr('data-midnight');
}
if($('body[data-footer-reveal="1"]').length > 0){
footerRevealCalcs();
if($('body[data-footer-reveal-shadow="large_2"]').length > 0) $('.container-wrap').css({ boxShadow: '0 70px 110px -30px '+$('#footer-outer').css('backgroundColor') });
}
function opaqueCheck(){
var $offset=$(window).scrollTop();
var $windowWidth=$(window).width();
if($offset > 0&&$windowWidth > 1000){
if($('#header-outer').attr('data-transparent-header')=='true'&&$('#header-outer[data-permanent-transparent="1"]').length==0) $('#header-outer').removeClass('transparent').addClass('scrolled-down');
$('.ns-loading-cover').hide();
$(window).off('scroll',opaqueCheck);
$(window).on('scroll',transparentCheck);
}}
function transparentCheck(){
var $offset=$(window).scrollTop();
var $windowWidth=$(window).width();
if($offset==0&&$windowWidth > 1000){
if($('#header-outer').attr('data-transparent-header')=='true') $('#header-outer').addClass('transparent').removeClass('scrolled-down');
$('.ns-loading-cover').show();
$(window).off('scroll',transparentCheck);
$(window).on('scroll',opaqueCheck);
}}
var adminBarHeight=($('#wpadminbar').length > 0) ? $('#wpadminbar').height():0;
function headerRowColorInheritInit(){
if($('body[data-header-inherit-rc="true"]').length > 0&&$('.mobile').length==0){
var headerOffset=($('#header-outer[data-permanent-transparent="1"]').length==0) ? (logoHeight - shrinkNum) + Math.ceil((headerPadding*2) / 1.8) + adminBarHeight:logoHeight/2 + headerPadding + adminBarHeight;
$('.main-content > .row > .wpb_row').each(function(){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if(direction=='down'){
if($that.find('.row-bg.using-bg-color').length > 0){
var $textColor=($that.find('> .col.span_12.light').length > 0) ? 'light-text':'dark-text';
$('#header-outer').css('background-color',$that.find('.row-bg').css('background-color')).removeClass('light-text').removeClass('dark-text').addClass($textColor);
$('#header-outer').attr('data-current-row-bg-color',$that.find('.row-bg').css('background-color'));
}else{
$('#header-outer').css('background-color',$('#header-outer').attr('data-user-set-bg')).removeClass('light-text').removeClass('dark-text');
$('#header-outer').attr('data-current-row-bg-color',$('#header-outer').attr('data-user-set-bg'));
}}else{
if($that.prev('div.wpb_row').find('.row-bg.using-bg-color').length > 0){
var $textColor=($that.prev('div.wpb_row').find('> .col.span_12.light').length > 0) ? 'light-text':'dark-text';
$('#header-outer').css('background-color',$that.prev('div.wpb_row').find('.row-bg').css('background-color')).removeClass('light-text').removeClass('dark-text').addClass($textColor);
$('#header-outer').attr('data-current-row-bg-color', $that.prev('div.wpb_row').find('.row-bg').css('background-color'));
}else{
$('#header-outer').css('background-color',$('#header-outer').attr('data-user-set-bg')).removeClass('light-text').removeClass('dark-text');
$('#header-outer').attr('data-current-row-bg-color',$('#header-outer').attr('data-user-set-bg'));
}}
},
offset: headerOffset
});
});
}}
if($('.page-submenu[data-sticky="true"]').length > 0&&$('#nectar_fullscreen_rows').length==0){
(function(){
'use strict'
var $=window.jQuery
var Waypoint=window.Waypoint
var $offsetHeight=0;
var shrinkNum=6;
var headerPadding=parseInt($('#header-outer').attr('data-padding'));
if($('#header-outer[data-shrink-num]').length > 0) shrinkNum=$('#header-outer').attr('data-shrink-num');
var headerPadding2=headerPadding - headerPadding/1.8;
var $headerHeight=($('#header-outer[data-header-resize="1"]').length > 0&&$('body.mobile').length==0) ? $('#header-outer').outerHeight() - (parseInt(shrinkNum) + headerPadding2*2):$('#header-outer').outerHeight();
if($('#header-secondary-outer').length > 0&&$('body.mobile').length==0) $headerHeight +=$('#header-secondary-outer').height();
$(window).on('smartresize',function(){
$headerHeight=($('#header-outer[data-header-resize="1"]').length > 0&&$('.small-nav').length==0&&$('body.mobile').length==0) ? $('#header-outer').outerHeight() - (parseInt(shrinkNum) + headerPadding2*2):$('#header-outer').outerHeight();
if($('#header-secondary-outer').length > 0&&$('body.mobile').length==0) $headerHeight +=$('#header-secondary-outer').height();
$offsetHeight=0;
if($('#wpadminbar').length > 0&&$('#wpadminbar').css('position')=='fixed') $offsetHeight +=$('#wpadminbar').height();
if($('body[data-hhun="0"] #header-outer').length > 0&&!($('body.mobile').length > 0&&$('#header-outer[data-mobile-fixed="false"]').length > 0)) $offsetHeight +=$headerHeight;
if($('.page-submenu.stuck').length > 0){
$('.page-submenu.stuck').addClass('no-trans').css('top',$offsetHeight).css('transform','translateY(0)').addClass('stuck');
var $that=this;
setTimeout(function(){ $('.page-submenu.stuck').removeClass('no-trans'); },50);
$('.page-submenu.stuck').parents('.wpb_row').css('z-index',10000);
if($('#boxed').length > 0){
var $negMargin=($(window).width() > 1000) ? $('.container-wrap').width()*0.04 :39;
$('.page-submenu.stuck').css({'margin-left':'-'+$negMargin+'px', 'width':$('.container-wrap').width()});
}}else{
$('.page-submenu.stuck').css('top','0').removeClass('stuck');
$('.page-submenu.stuck').parents('.wpb_row').css('z-index','auto');
if($('#boxed').length > 0) $('.page-submenu.stuck').css({'margin-left':'0px', 'width':'100%'});
}});
function Sticky(options){
this.options=$.extend({}, Waypoint.defaults, Sticky.defaults, options)
this.element=this.options.element
this.$element=$(this.element)
this.createWrapper()
this.createWaypoint()
}
Sticky.prototype.createWaypoint=function(){
var originalHandler=this.options.handler
$offsetHeight=0;
if($('#wpadminbar').length > 0&&$('#wpadminbar').css('position')=='fixed') $offsetHeight +=$('#wpadminbar').height();
if($('body[data-hhun="0"] #header-outer').length > 0&&!($('body.mobile').length > 0&&$('#header-outer[data-mobile-fixed="false"]').length > 0)) $offsetHeight +=$headerHeight;
this.waypoint=new Waypoint($.extend({}, this.options, {
element: this.wrapper,
handler: $.proxy(function(direction){
var shouldBeStuck=this.options.direction.indexOf(direction) > -1
var wrapperHeight=shouldBeStuck ? this.$element.outerHeight(true):''
this.$wrapper.height(wrapperHeight)
if(shouldBeStuck){
this.$element.addClass('no-trans').css('top',$offsetHeight).css('transform','translateY(0)').addClass('stuck');
var $that=this;
setTimeout(function(){ $that.$element.removeClass('no-trans'); },50);
this.$element.parents('.wpb_row').css('z-index',10000);
if($('#boxed').length > 0){
var $negMargin=($(window).width() > 1000) ? $('.container-wrap').width()*0.04 :39;
this.$element.css({'margin-left':'-'+$negMargin+'px', 'width':$('.container-wrap').width()});
}}else{
this.$element.css('top','0').removeClass('stuck');
if($('#boxed').length > 0) this.$element.css({'margin-left':'0px', 'width':'100%'});
}
if(originalHandler){
originalHandler.call(this, direction)
}}, this),
offset: $offsetHeight
}))
var $that=this;
setInterval(function(){
if($('body[data-hhun="1"] #header-outer.detached:not(.invisible)').length > 0)
$that.waypoint.options.offset=$offsetHeight + $headerHeight;
else
$that.waypoint.options.offset=$offsetHeight;
Waypoint.refreshAll();
},100);
}
Sticky.prototype.createWrapper=function(){
if(this.options.wrapper){
this.$element.wrap(this.options.wrapper)
}
this.$wrapper=this.$element.parent()
this.wrapper=this.$wrapper[0]
}
Sticky.prototype.destroy=function(){
if(this.$element.parent()[0]===this.wrapper){
this.waypoint.destroy()
this.$element.removeClass(this.options.stuckClass)
if(this.options.wrapper){
this.$element.unwrap()
}}
}
Sticky.defaults={
wrapper: '',
stuckClass: 'stuck',
direction: 'down right'
}
Waypoint.Sticky=Sticky
}())
;
if($('.page-submenu').parents('.span_12').find('> .wpb_column').length > 1){
var pageMenu=$('.page-submenu').clone();
var pageMenuParentRow=$('.page-submenu').parents('.wpb_row');
$('.page-submenu').remove();
pageMenuParentRow.before(pageMenu);
}
var sticky=new Waypoint.Sticky({
element: $('.page-submenu[data-sticky="true"]')[0]
});
}
if($('#nectar_fullscreen_rows').length==0)
$('.page-submenu').parents('.wpb_row').css('z-index',10000);
$('.page-submenu .mobile-menu-link').on('click',function(){
$(this).parents('.page-submenu').find('ul').stop(true).slideToggle(350);
return false;
});
$('.page-submenu ul li a').on('click',function(){
if($('body.mobile').length > 0) $(this).parents('.page-submenu').find('ul').stop(true).slideToggle(350);
});
$('body').on('click','#toggle-nav',function(){
$(this).find('.lines-button').toggleClass('close');
$('#mobile-menu').stop(true,true).slideToggle(500);
return false;
});
if($('header#top nav > ul > li.menu-item-language').length > 0&&$('#header-secondary-outer ul > li.menu-item-language').length==0){
var $langSelector=$('header#top nav > ul > li.menu-item-language').clone();
$langSelector.insertBefore('#mobile-menu ul #mobile-search');
}
$('#mobile-menu .container ul li').each(function(){
if($(this).find('> ul').length > 0){
$(this).addClass('has-ul');
$(this).find('> a').append('');
}});
$('#mobile-menu .container ul li:has(">ul") > a .sf-sub-indicator').click(function(){
$(this).parent().parent().toggleClass('open');
$(this).parent().parent().find('> ul').stop(true,true).slideToggle();
return false;
});
function piVertCenter(){
$('.portfolio-items > .col').each(function(){
$(this).find('.style-4 .work-info .bottom-meta:not(.shown)').stop().animate({
'bottom':'-'+$(this).find('.work-info .bottom-meta').outerHeight()-2+'px'
},420,'easeOutCubic');
});
}
$(window).load(function(){
portfolioCommentOrder();
fullWidthContentColumns();
resizeVideoToCover();
});
function ie8Width(){
if($(window).width() >=1300){
$('.container').css('max-width','1100px');
}else{
$('.container').css('max-width','880px');
}}
if($(window).width() >=1300&&$('html').hasClass('no-video')){ $('.container').css('max-width','1100px'); $(window).resize(ie8Width); };
function smartResizeInit(){
carouselHeightCalcs();
clientsCarouselHeightRecalc();
portfolioCommentOrder();
testimonialHeightResize();
testimonialSliderHeight();
fullWidthContentColumns();
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)){
parallaxRowsBGCals();
}
headerSpace();
centeredLogoMargins();
slideOutWidgetOverflowState();
recentPostHeight();
morphingOutlines();
flipBoxHeights();
if($('.slide-out-widget-area-toggle a.open').length > 0&&$('#header-outer[data-full-width="true"]').length > 0) fullWidthHeaderSlidingWidgetMenuCalc();
}
$(window).off('smartresize.srInit');
$(window).on('smartresize.srInit', smartResizeInit);
function resizeInit(){
portfolioDeviceCheck();
fullWidthSections();
fullwidthImgOnlySizing();
fullWidthContentColumns();
fullWidthRowPaddingAdjustCalc();
responsiveVideoIframes();
videoshortcodeSize();
if($('.nectar-social.full-width').length > 0){
nectarLoveFWCenter();
}
if($('body').hasClass('ascend')){
searchFieldCenter();
}
if($('body').hasClass('single-post')) centerPostNextButtonImg();
sidebarPxConversion();
cascadingImageBGSizing();
responsiveTooltips();
if($('[class*="vc_col-xs-"], [class*="vc_col-md-"], [class*="vc_col-lg-"]').length > 0) vcMobileColumns();
if($('body[data-footer-reveal="1"]').length > 0) footerRevealCalcs();
if($('#page-header-bg').length > 0) pageHeader();
if($('.nectar-video-bg').length > 0){
resizeVideoToCover();
}}
$(window).off('resize.srInit');
$(window).on('resize.srInit', resizeInit);
$(window).on("orientationchange",function(){
setTimeout(clientsCarouselHeightRecalc,200);
});
function postNextButtonEffect(){
$('.blog_next_prev_buttons').imagesLoaded(function(){
centerPostNextButtonImg();
$('.blog_next_prev_buttons img').css('opacity','1');
if(!$('body').hasClass('mobile')&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
$('.blog_next_prev_buttons img').panr({
scaleDuration: .28,
sensitivity: 22,
scaleTo: 1.06
});
}});
}
function centerPostNextButtonImg(){
if($('.blog_next_prev_buttons').length==0) return false;
if($('.blog_next_prev_buttons img').height() >=$('.blog_next_prev_buttons').height() + 50){
var $height='auto';
var $width=$('.blog_next_prev_buttons').width();
}else{
if($('.blog_next_prev_buttons').width() < $('.blog_next_prev_buttons img').width()){
var $height=$('.blog_next_prev_buttons').height() + 49;
var $width='auto';
}else{
var $height='auto';
var $width='100%';
}}
$('.blog_next_prev_buttons img').css({ 'height':$height, 'width': $width });
$('.blog_next_prev_buttons img').css({
'top':($('.blog_next_prev_buttons').height()/2) - ($('.blog_next_prev_buttons img').height()/2) + 'px',
'left':($('.blog_next_prev_buttons').width()/2) - ($('.blog_next_prev_buttons img').width()/2) + 'px'
});
$('.blog_next_prev_buttons .inner').each(function(){
$(this).css({'top': $(this).parent().height()/2 - ($(this).height()/2), 'opacity':'1' });
})
}
postNextButtonEffect();
function recentPostHeight(){
$('.blog-recent[data-style="title_only"]').each(function(){
if($(this).find('> .col').length > 1) return false;
if($(this).parent().parent().parent().hasClass('vc_col-sm-3') ||
$(this).parent().parent().parent().hasClass('vc_col-sm-4') ||
$(this).parent().parent().parent().hasClass('vc_col-sm-6') ||
$(this).parent().parent().parent().hasClass('vc_col-sm-8') ||
$(this).parent().parent().parent().hasClass('vc_col-sm-9')){
if($('body.mobile').length==0&&$(this).next('div').length==0){
var tallestColumn=0;
$(this).find('> .col').css('padding', '50px 20px');
$(this).parents('.span_12').find(' > .wpb_column').each(function(){
(Math.floor($(this).height()) > tallestColumn) ? tallestColumn=Math.floor($(this).height()):tallestColumn=tallestColumn;
});
if(Math.floor($(this).find('> .col').outerHeight(true)) < Math.floor($(this).parents('.wpb_row').height()) - 1){
$(this).find('> .col').css('padding-top',(tallestColumn-$(this).find('> .col').height())/2 + 'px');
$(this).find('> .col').css('padding-bottom',(tallestColumn-$(this).find('> .col').height())/2 + 'px');
}}else{
$(this).find('> .col').css('padding', '50px 20px');
}}
});
}
recentPostHeight();
function recentPostsFlickityInit(){
if($('.nectar-recent-posts-slider-inner').length==0) return false;
var $rpF=$('.nectar-recent-posts-slider-inner').flickity({
contain: true,
draggable: true,
lazyLoad: false,
imagesLoaded: true,
percentPosition: true,
prevNextButtons: false,
pageDots: true,
resize: true,
setGallerySize: true,
wrapAround: true,
accessibility: false
});
setTimeout(function(){
$('.nectar-recent-posts-slider-inner').addClass('loaded');
},1150);
var flkty=$rpF.data('flickity');
$rpF.on('dragStart', function(){
$('.flickity-viewport').addClass('is-moving');
});
$rpF.on('dragEnd', function(){
$('.flickity-viewport').removeClass('is-moving');
});
recentPostSliderHeight();
$(window).resize(recentPostSliderHeight);
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/))
$(window).resize(recentPostSliderParallaxMargins);
function recentPostSliderHeight(){
$('.nectar-recent-posts-slider').each(function(){
var $heightCalc;
var $minHeight=250;
var $windowWidth=$(window).width();
var $definedHeight=parseInt($(this).attr('data-height'));
var dif=($('body[data-ext-responsive="true"]').length > 0) ? $(window).width() / 1400:$(window).width() / 1100;
if(window.innerWidth > 1000&&$('#boxed').length==0){
if($(this).parents('.full-width-content').length==0){
if($('body[data-ext-responsive="true"]').length > 0&&window.innerWidth >=1400){
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight));
}else if($('body[data-ext-responsive="true"]').length==0&&window.innerWidth >=1100){
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight));
}else{
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif));
}}else{
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif));
}}else{
var $parentCol=($(this).parents('.wpb_column').length > 0) ? $(this).parents('.wpb_column'):$(this).parents('.col') ;
if($parentCol.length==0) $parentCol=$('.main-content');
if(!$parentCol.hasClass('vc_span12')&&!$parentCol.hasClass('main-content')&&!$parentCol.hasClass('span_12')&&!$parentCol.hasClass('vc_col-sm-12')){
var $parentColWidth=sliderColumnDesktopWidth($parentCol);
var $aspectRatio=$definedHeight/$parentColWidth;
if($aspectRatio*$parentCol.width() <=$minHeight){
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$minHeight);
}else{
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$aspectRatio*$parentCol.width());
}}else{
if($definedHeight*dif <=$minHeight){
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$minHeight);
}else{
$(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif));
}}
}});
}
function sliderColumnDesktopWidth(parentCol){
var $parentColWidth=1100;
var $columnNumberParsed=$(parentCol).attr('class').match(/\d+/);
if($columnNumberParsed=='2'){ $parentColWidth=170 }
else if($columnNumberParsed=='3'){ $parentColWidth=260 }
else if($columnNumberParsed=='4'){ $parentColWidth=340 }
else if($columnNumberParsed=='6'){ $parentColWidth=530 }
else if($columnNumberParsed=='8'){ $parentColWidth=700 }
else if($columnNumberParsed=='9'){ $parentColWidth=805 }
else if($columnNumberParsed=='10'){ $parentColWidth=916.3 }
else if($columnNumberParsed=='12'){ $parentColWidth=1100 }
return $parentColWidth;
}}
recentPostsFlickityInit();
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/))
if($('.nectar-recent-posts-slider').length > 0) window.requestAnimationFrame(recentPostSliderParallax);
function recentPostSliderParallax(){
$('.nectar-recent-posts-slider').each(function(){
var $offset=parseInt($(this).find('.flickity-slider').position().left);
var $slideLength=$(this).find('.nectar-recent-post-slide').length;
var $lastChildIndex=$(this).find('.nectar-recent-post-slide:last-child').index();
var $slideWidth=$(this).find('.nectar-recent-post-slide').width();
if($offset >=-3){
$(this).find('.nectar-recent-post-slide:last-child .nectar-recent-post-bg').css('margin-left',parseInt(Math.ceil($slideWidth/3.5))+'px');
}else{
$(this).find('.nectar-recent-post-slide:last-child .nectar-recent-post-bg').css('margin-left','-'+parseInt(Math.ceil($slideWidth/3.5*$lastChildIndex))+'px');
}
if(Math.abs($offset) >=($slideLength-1) * $slideWidth){
$(this).find('.nectar-recent-post-slide:first-child .nectar-recent-post-bg').css('margin-left','-'+parseInt(Math.ceil(($slideWidth/3.5)*$slideLength))+'px');
}else{
$(this).find('.nectar-recent-post-slide:first-child .nectar-recent-post-bg').css('margin-left','0px');
}
$(this).find('.nectar-recent-post-bg').css('transform','translateX('+Math.ceil($(this).find('.flickity-slider').position().left/-3.5)+'px)');
});
requestAnimationFrame(recentPostSliderParallax);
}
function recentPostSliderParallaxMargins(){
$('.nectar-recent-posts-slider').each(function(){
var $slideWidth=$(this).find('.nectar-recent-post-slide').width();
$(this).find('.nectar-recent-post-slide').each(function(i){
$(this).find('.nectar-recent-post-bg').css('margin-left','-'+ parseInt(Math.ceil($slideWidth/3.5)*i)+'px');
});
});
}
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/))
recentPostSliderParallaxMargins();
function portfolioHoverEffects(){
if(!$('body').hasClass('mobile')&&!navigator.userAgent.match(/(iPad|IEMobile)/)){
$('.portfolio-items .col .work-item:not(.style-3-alt):not(.style-3):not([data-custom-content="on"])').hover(function(){
$(this).find('.work-info .vert-center').css({'margin-top':0});
$(this).find('.work-info, .work-info .vert-center *, .work-info > i').css({'opacity':1});
$(this).find('.work-info-bg').css({ 'opacity':0.9 });
},function(){
$(this).find('.work-info .vert-center').css({ 'margin-top':-20 });
$(this).find('.work-info, .work-info .vert-center *, .work-info > i').css({ 'opacity':0 });
$(this).find('.work-info-bg').css({ 'opacity':0 });
});
$('.portfolio-items .col .work-item.style-3').hover(function(){
$(this).find('.work-info-bg').css({ 'opacity':0 });
},function(){
$(this).find('.work-info-bg').css({ 'opacity':0.45 });
});
$('.portfolio-items .col .work-item.style-4').hover(function(){
$(this).find('img').stop().animate({
'top':'-'+$(this).find('.work-info .bottom-meta').outerHeight()/2+'px'
},250,'easeOutCubic');
$(this).find('.work-info .bottom-meta').addClass('shown').stop().animate({
'bottom':'0px'
},320,'easeOutCubic');
},function(){
$(this).find('img').stop().animate({
'top':'0px'
},250,'easeOutCubic');
$(this).find('.work-info .bottom-meta').removeClass('shown').stop().animate({
'bottom':'-'+$(this).find('.work-info .bottom-meta').outerHeight()-2+'px'
},320,'easeOutCubic');
});
}else{
portfolioDeviceCheck();
}}
portfolioHoverEffects();
function style6Img(){
$('.style-5').each(function(){
$(this).find('.sizer').insertBefore($(this).find('.parallaxImg'));
});
$('.style-5').parents('.wpb_row').css('z-index','100');
var d=document,
de=d.documentElement,
bd=d.getElementsByTagName('body')[0],
htm=d.getElementsByTagName('html')[0],
win=window,
imgs=d.querySelectorAll('.parallaxImg'),
totalImgs=imgs.length,
supportsTouch='ontouchstart' in win||navigator.msMaxTouchPoints;
if(totalImgs <=0){
return;
}
for(var l=0;l');
if(!(navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1)){ $(thisImg).parent().append(shadowHTML); }
var w=thisImg.clientWidth||thisImg.offsetWidth||thisImg.scrollWidth;
if(supportsTouch){
/*win.preventScroll=false;
(function(_thisImg,_layers,_totalLayers,_shine){
$(thisImg).parents('.style-5').on('touchmove', function(e){
if(win.preventScroll){
e.preventDefault();
}
window.requestAnimationFrame(function(){
processMovement(e,true,_thisImg,_layers,_totalLayers,_shine);
});
});
$(thisImg).parents('.style-5').on('touchstart', function(e){
win.preventScroll=true;
processEnter(e,_thisImg,_layers,_totalLayers,_shine);
});
$(thisImg).parents('.style-5').on('touchend', function(e){
win.preventScroll=false;
processExit(e,_thisImg,_layers,_totalLayers,_shine);
});
})(thisImg,layers,totalLayerElems,shineHTML); */
}else{
(function(_thisImg,_layers,_totalLayers,_shine){
$(thisImg).parents('.style-5').on('mousemove', function(e){
var now=Date.now();
if(now > lastMove + eventThrottle){
lastMove=now;
window.requestAnimationFrame(function(){
processMovement(e,false,_thisImg,_layers,_totalLayers,_shine);
});
}});
$(thisImg).parents('.style-5').on('mouseenter', function(e){
processEnter(e,_thisImg,_layers,_totalLayers,_shine);
});
$(thisImg).parents('.style-5').on('mouseleave', function(e){
processExit(e,_thisImg,_layers,_totalLayers,_shine);
});
})(thisImg,layers,totalLayerElems,shineHTML);
}
(function(_thisImg,_layers,_totalLayers,_shine){
depths(false,_thisImg,_layers,_totalLayers,_shine);
window.addEventListener('resize', function(e){
depths(false,_thisImg,_layers,_totalLayers,_shine);
});
})(thisImg,layers,totalLayerElems,shineHTML);
}
function processMovement(e, touchEnabled, elem, layers, totalLayers, shine){
if(!$(elem.firstChild).hasClass('over')){ processExit(e,elem,layers,totalLayers,shine); return false }
if($(elem).parents('.col.wide').length > 0){
var yMult=0.03;
var xMult=0.063;
}else if($(elem).parents('.col.regular').length > 0){
var yMult=0.045;
var xMult=0.045;
}else if($(elem).parents('.col.tall').length > 0){
var yMult=0.05;
var xMult=0.015;
}else if($(elem).parents('.col.wide_tall').length > 0){
var yMult=0.04;
var xMult=0.04;
}else{
var yMult=0.045;
var xMult=0.075;
}
var bdst=bd.scrollTop||htm.scrollTop,
bdsl=bd.scrollLeft,
pageX=(touchEnabled)? e.touches[0].pageX:e.pageX,
pageY=(touchEnabled)? e.touches[0].pageY:e.pageY,
offsets=elem.getBoundingClientRect(),
w=elem.clientWidth||elem.offsetWidth||elem.scrollWidth,
h=elem.clientHeight||elem.offsetHeight||elem.scrollHeight,
wMultiple=320/w,
offsetX=0.52 - (pageX - offsets.left - bdsl)/w,
offsetY=0.52 - (pageY - offsets.top - bdst)/h,
dy=(pageY - offsets.top - bdst) - h / 2,
dx=(pageX - offsets.left - bdsl) - w / 2,
yRotate=(offsetX - dx)*(yMult * wMultiple),
xRotate=(dy - offsetY)*(xMult * wMultiple);
if($(elem).parents('.wide_tall').length==0&&$(elem).parents('.wide').length==0&&$(elem).parents('.tall').length==0){
var imgCSS=' perspective('+ w*3 +'px) rotateX(' + xRotate + 'deg) rotateY(' + yRotate + 'deg) translateY('+offsetY*-10+'px) translateX('+offsetX*-10+'px) scale(1.03)';
}else{
var imgCSS=' perspective('+ w*3 +'px) rotateX(' + xRotate + 'deg) rotateY(' + yRotate + 'deg) translateY('+offsetY*-10+'px) translateX('+offsetX*-10+'px) scale(1.013)';
}
if(elem.firstChild.className.indexOf(' over')!=-1){
if($(elem).parents('.portfolio-items.masonry-items').length > 0){
}else{
}}
$(elem).find('.parallaxImg-container').css('transform',imgCSS);
if(!(navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1)){
$(elem).parents('.parallaxImg-wrap').find('.parallaxImg-shadow').css('transform',imgCSS);
}}
function processShineMovement(e, touchEnabled, elem, layers, totalLayers, shine){
var bdst=bd.scrollTop||htm.scrollTop,
bdsl=bd.scrollLeft,
pageX=(touchEnabled)? e.touches[0].pageX:e.pageX,
pageY=(touchEnabled)? e.touches[0].pageY:e.pageY,
offsets=elem.getBoundingClientRect(),
w=elem.clientWidth||elem.offsetWidth||elem.scrollWidth,
h=elem.clientHeight||elem.offsetHeight||elem.scrollHeight,
wMultiple=320/w,
offsetX=0.52 - (pageX - offsets.left - bdsl)/w,
offsetY=0.52 - (pageY - offsets.top - bdst)/h,
dy=(pageY - offsets.top - bdst) - h / 2,
dx=(pageX - offsets.left - bdsl) - w / 2,
yRotate=(offsetX - dx)*(0.040 * wMultiple),
xRotate=(dy - offsetY)*(0.070 * wMultiple),
arad=Math.atan2(dy, dx),
angle=arad * 180 / Math.PI - 90;
if(angle < 0){
angle=angle + 360;
}
shine.style.background='linear-gradient(' + angle + 'deg, rgba(255,255,255,' + (pageY - offsets.top - bdst)/h * 0.3 + ') 0%,rgba(255,255,255,0) 80%)';
shine.style.transform='translateX(' + (offsetX * totalLayers) - 0.1 + 'px) translateY(' + (offsetY * totalLayers) - 0.1 + 'px) ';
}
function processEnter(e, elem, layers, totalLayers, shine){
elem.firstChild.className +=' over';
elem.className +=' over';
$(elem).addClass('transition');
var $timeout=setTimeout(function(){ $(elem).removeClass('transition'); },200);
}
function processExit(e, elem, layers, totalLayers, shine){
var w=elem.clientWidth||elem.offsetWidth||elem.scrollWidth;
var container=elem.firstChild;
container.className=container.className.replace(' over','');
elem.className=elem.className.replace(' over','');
$(container).css('transform', 'perspective('+ w*3 +'px) rotateX(0deg) rotateY(0deg) translateZ(0)');
$(elem).parents('.parallaxImg-wrap').find('.parallaxImg-shadow').css('transform','perspective('+ w*3 +'px) rotateX(0deg) rotateY(0deg) translateZ(0)');
$(elem).addClass('transition');
var $timeout=setTimeout(function(){ $(elem).removeClass('transition'); },200);
}
function depths(touchEnabled, elem, layers, totalLayers, shine){
var w=elem.clientWidth||elem.offsetWidth||elem.scrollWidth;
var revNum=totalLayers;
var container=elem.firstChild;
for(var ly=0;ly 0){
$('.portfolio-items .col .work-item').find('a.pp').css('display','none');
}else{
$('.portfolio-items .col .work-item').find('a:not(".pp")').css('display','none');
}}else{
$('.portfolio-items .col .work-item').find('a').css('display','inline');
}}
function portfolioAccentColor(){
var portfolioSocialColorCss='';
$('.portfolio-items .col').each(function(){
if($(this).has('[data-project-color]')){
$(this).find('.work-info-bg, .bottom-meta').css('background-color',$(this).attr('data-project-color'));
$(this).find('.parallaxImg-rendered-layer .bg-overlay').css('border-color',$(this).attr('data-project-color'));
var $projColor=$(this).attr('data-project-color');
if($(this).find('.custom-content .nectar-social').length > 0&&$('body[data-button-style="rounded"]')) portfolioSocialColorCss +='body[data-button-style="rounded"] .col[data-project-color="'+$projColor+'"] .custom-content .nectar-social > *:hover i { color: '+ $projColor +'!important; } ';
}});
if(portfolioSocialColorCss.length > 1){
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=portfolioSocialColorCss;
}else{
style.appendChild(document.createTextNode(portfolioSocialColorCss));
}
head.appendChild(style);
}}
portfolioAccentColor();
$('body').on('mouseenter','.portfolio-filters',function(){
$(this).find('> ul').stop(true,true).slideDown(500,'easeOutExpo');
$(this).find('a#sort-portfolio span').html($(this).find('a#sort-portfolio').attr('data-sortable-label'));
});
$('body').on('mouseleave','.portfolio-filters',function(){
var $activeCat=$(this).find('a.active').html();
if(typeof $activeCat=='undefined'||$activeCat.length==0) $activeCat=$(this).attr('data-sortable-label');
$(this).find('a#sort-portfolio span').html($activeCat);
$(this).find('> ul').stop(true,true).slideUp(500,'easeOutExpo');
});
$('body').on('click','.portfolio-filters ul li a', function(){
$(this).parents('.portfolio-filters').find('#sort-portfolio span').html($(this).html());
});
$('body').on('click','.portfolio-filters-inline ul li a',function(){
$(this).parents('ul').find('li a').removeClass('active');
$(this).addClass('active');
$(this).parents('.portfolio-filters-inline').find('#current-category').html($(this).html());
});
function portfolioFiltersInit(){
if($('body').hasClass('mobile')||navigator.userAgent.match(/(iPad|IEMobile)/)){
$('.portfolio-filters').unbind('mouseenter mouseleave');
$('.portfolio-filters > a, .portfolio-filters ul li a').click(function(e){
if(e.originalEvent!==undefined) $(this).parents('.portfolio-filters').find('> ul').stop(true,true).slideToggle(600,'easeOutCubic');
});
}
$('.portfolio-filters-inline .container > ul > li:nth-child(2) a').click();
$('body.single-portfolio #header-outer nav > ul > li > a:contains("Portfolio")').parents('li').addClass('current-menu-item');
$('body.single-post #header-outer nav > ul > li > a:contains("Blog")').parents('li').addClass('current-menu-item');
}
portfolioFiltersInit();
function centerLove(){
$('.post').each(function(){
var $loveWidth=$(this).find('.post-meta .nectar-love').outerWidth();
var $loveWrapWidth=$(this).find('.post-meta .nectar-love-wrap').width();
$(this).find('.post-meta .nectar-love').css('margin-left', $loveWrapWidth/2 - $loveWidth/2 + 'px');
$(this).find('.nectar-love-wrap').css('visibility','visible');
});
}
$('.nectar-love').on('click',function(){
centerLove();
});
centerLove();
function portfolioCommentOrder(){
if($('body').hasClass('mobile')&&$('body').hasClass('single-portfolio')&&$('#respond').length > 0){
$('#sidebar').insertBefore('.comments-section');
}
else if($('body').hasClass('single-portfolio')&&$('#respond').length > 0){
$('#sidebar').insertAfter('#post-area');
}}
portfolioCommentOrder();
var sidebarFollow=$('.single-portfolio #sidebar').attr('data-follow-on-scroll');
function portfolioSidebarFollow(){
sidebarFollow=$('.single-portfolio #sidebar').attr('data-follow-on-scroll');
if($('body.single-portfolio').length > 0&&sidebarFollow==1&&!$('body').hasClass('mobile')&&parseInt($('#sidebar').height()) + 50 <=parseInt($('#post-area').height())){
$('#sidebar').addClass('fixed-sidebar');
var $footer=($('.comment-wrap.full-width-section').length==0) ? '#footer-outer':'.comment-wrap';
if($('#call-to-action').length > 0) $footer='#call-to-action';
sidebarPxConversion();
$('#sidebar').stickyMojo({footerID: $footer, contentID: '#post-area'});
}}
function sidebarPxConversion(){
if($('body.single-portfolio').length > 0&&sidebarFollow==1&&!$('body').hasClass('mobile')){
var $containerWidth=$('.main-content > .row').width();
var $sidebarWidth=$containerWidth*.235;
if(window.innerWidth > 1300){
$sidebarWidth=$containerWidth*.235;
}else if(window.innerWidth < 1300&&window.innerWidth > 1000){
$sidebarWidth=$containerWidth*.273;
}
$('#sidebar').css('width',$sidebarWidth+'px');
}}
$(window).load(function(){
setTimeout(portfolioSidebarFollow,200);
});
function isotopeCatSelection(){
$('.portfolio-items:not(".carousel")').each(function(){
var isotopeCatArr=[];
var $portfolioCatCount=0;
$(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(i){
if($(this).find('a').length > 0){
isotopeCatArr[$portfolioCatCount]=$(this).find('a').attr('data-filter').substring(1);
$portfolioCatCount++;
}});
isotopeCatArr.shift();
var itemCats='';
$(this).find('> div').each(function(i){
itemCats +=$(this).attr('data-project-cat');
});
itemCats=itemCats.split(' ');
itemCats.pop();
itemCats=$.unique(itemCats);
if($(this).attr('data-categories-to-show').length!=0&&$(this).attr('data-categories-to-show')!='all'){
$userSelectedCats=$(this).attr('data-categories-to-show').replace(/,/g , ' ');
$userSelectedCats=$userSelectedCats.split(' ');
if(!$(this).hasClass('infinite_scroll')) $(this).removeAttr('data-categories-to-show');
}else{
$userSelectedCats=itemCats;
}
var notFoundCats=[];
$.grep(isotopeCatArr, function(el){
if($.inArray(el, itemCats)==-1) notFoundCats.push(el);
if($.inArray(el, $userSelectedCats)==-1) notFoundCats.push(el);
});
if(notFoundCats.length!=0){
$(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(){
if($(this).find('a').length > 0){
if($.inArray($(this).find('a').attr('data-filter').substring(1), notFoundCats)!=-1){
$(this).hide();
}else{
$(this).show();
}}
})
}});
}
isotopeCatSelection();
/*jQuery.sharedCount=function(url, fn){
url=encodeURIComponent(url||location.href);
var arg={
url: "//" + (location.protocol=="https:" ? "sharedcount.appspot":"api.sharedcount") + ".com/?url=" + url,
cache: true,
dataType: "json"
};
if('withCredentials' in new XMLHttpRequest){
arg.success=fn;
}else{
var cb="sc_" + url.replace(/\W/g, '');
window[cb]=fn;
arg.jsonpCallback=cb;
arg.dataType +="p";
}
return jQuery.ajax(arg);
};*/
var completed=0;
var windowLocation=window.location.href.replace(window.location.hash, '');
function facebookShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
window.open('https://www.facebook.com/sharer/sharer.php?u='+windowLocation, "facebookWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function googlePlusShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
window.open('https://plus.google.com/share?url='+windowLocation, "googlePlusWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function twitterShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
if($(".section-title h1").length > 0){
var $pageTitle=encodeURIComponent($(".section-title h1").text());
}else{
var $pageTitle=encodeURIComponent($(document).find("title").text());
}
window.open('http://twitter.com/intent/tweet?text='+$pageTitle +' '+windowLocation, "twitterWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function wooTwitterShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
window.open('http://twitter.com/intent/tweet?text='+$("h1.product_title").text() +' '+windowLocation, "twitterWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function linkedInShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
if($(".section-title h1").length > 0){
var $pageTitle=encodeURIComponent($(".section-title h1").text());
}else{
var $pageTitle=encodeURIComponent($(document).find("title").text());
}
window.open('http://www.linkedin.com/shareArticle?mini=true&url='+windowLocation+'&title='+$pageTitle+'', "linkedInWindow", "height=480,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function woolinkedInShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
window.open('http://www.linkedin.com/shareArticle?mini=true&url='+windowLocation+'&title='+$("h1.product_title").text(), "twitterWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function pinterestShare(){
windowLocation=window.location.href.replace(window.location.hash, '');
var $sharingImg=($('.single-portfolio').length > 0&&$('div[data-featured-img]').attr('data-featured-img')!='empty') ? $('div[data-featured-img]').attr('data-featured-img'):$('#ajax-content-wrap img').first().attr('src');
if($(".section-title h1").length > 0){
var $pageTitle=encodeURIComponent($(".section-title h1").text());
}else{
var $pageTitle=encodeURIComponent($(document).find("title").text());
}
window.open('http://pinterest.com/pin/create/button/?url='+windowLocation+'&media='+$sharingImg+'&description='+$pageTitle, "pinterestWindow", "height=640,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function wooPinterestShare(){
$imgToShare=($('img.attachment-shop_single').length > 0) ? $('img.attachment-shop_single').first().attr('src'):$('.single-product-main-image img').first().attr('src');
windowLocation=window.location.href.replace(window.location.hash, '');
window.open('http://pinterest.com/pin/create/button/?url='+windowLocation+'&media='+$imgToShare+'&description='+$('h1.product_title').text(), "pinterestWindow", "height=640,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0")
return false;
}
function socialFade(){
if(completed==$('a.nectar-sharing').length&&$('a.nectar-sharing').parent().hasClass('in-sight')){
$('.nectar-social .nectar-love span').show(350,'easeOutSine',function(){
$(this).stop().animate({'opacity':1},800);
});
$('.nectar-social > a').each(function(i){
var $that=$(this);
$(this).find('> span').show(350,'easeOutSine',function(){
$that.find('> span').stop().animate({'opacity':1},800);
});
});
var $totalShares=0;
$('.nectar-social > a .count').each(function(){
$totalShares +=parseInt($(this).html());
});
if($totalShares!=1){
$('.single .meta-share-count .plural').css({'opacity':'1', 'display':'inline'});
$('.single .meta-share-count .singular').remove();
}else{
$('.single .meta-share-count .singular').css({'opacity':'1', 'position':'relative', 'display':'inline'});
$('.single .meta-share-count .plural').remove();
}
$('.meta-share-count .share-count-total').html($totalShares).css('opacity',1);
}}
$('body').on('click','#single-below-header .nectar-social a', function(){ return false; });
$('body').on('click','.facebook-share:not(.inactive)', facebookShare);
$('body').on('click','.google-plus-share:not(.inactive)', googlePlusShare);
$('body').on('click','.nectar-social:not(".woo") .twitter-share:not(.inactive)', twitterShare);
$('body').on('click','.nectar-social.woo .twitter-share', wooTwitterShare);
$('body').on('click','.nectar-social:not(".woo") .linkedin-share:not(.inactive)', linkedInShare);
$('body').on('click','.nectar-social.woo .linkedin-share', woolinkedInShare);
$('body').on('click','.nectar-social:not(".woo") .pinterest-share:not(.inactive)', pinterestShare);
$('body').on('click','.nectar-social.woo .pinterest-share', wooPinterestShare);
function socialSharingInit(){
if($('body').hasClass('mobile')&&$('.single-post .fullscreen-header').length > 0){
$('#single-below-header .nectar-social .nectar-sharing, #single-below-header .nectar-social .nectar-sharing-alt').addClass('inactive');
}
completed=0;
if($('a.facebook-share').length > 0||$('a.twitter-share').length > 0||$('a.google-plus-share').length > 0||$('a.linkedin-share').length > 0||$('a.pinterest-share').length > 0){
if($('a.facebook-share:not(.sharing-default-minimal a.facebook-share)').length > 0&&$('body[data-button-style="rounded"]').length==0||$('#project-meta a.facebook-share').length > 0||$('#single-meta a.facebook-share').length > 0||$('#single-below-header .facebook-share').length > 0){
$.getJSON("https://graph.facebook.com/?id="+ windowLocation +'&callback=?', function(data){
if((data.shares!=0)&&(data.shares!=undefined)&&(data.shares!=null)){
$('.facebook-share a span.count, a.facebook-share span.count').html(data.shares);
}else{
$('.facebook-share a span.count, a.facebook-share span.count').html(0);
}
completed++;
socialFade();
});
}else if($('a.facebook-share').length > 0&&$('body[data-button-style="rounded"]').length > 0||$('.sharing-default-minimal a.facebook-share').length > 0){
completed++;
socialFade();
}
if($('a.twitter-share:not(.sharing-default-minimal a.twitter-share)').length > 0&&$('body[data-button-style="rounded"]').length==0||$('#project-meta a.twitter-share').length > 0||$('#single-meta a.twitter-share').length > 0||$('#single-below-header .twitter-share').length > 0){
$('.twitter-share a span.count, a.twitter-share span.count').html(0);
completed++;
socialFade();
}else if($('a.twitter-share').length > 0&&$('body[data-button-style="rounded"]').length > 0||$('.sharing-default-minimal a.twitter-share').length > 0){
completed++;
socialFade();
}
if($('a.linkedin-share:not(.sharing-default-minimal a.linkedin-share)').length > 0&&$('body[data-button-style="rounded"]').length==0||$('#project-meta a.linkedin-share').length > 0||$('#single-meta a.linkedin-share').length > 0||$('#single-below-header .linkedin-share').length > 0){
$('.linkedin-share a span.count, a.linkedin-share span.count').html(0);
completed++;
socialFade();
}else if($('a.linkedin-share').length > 0&&$('body[data-button-style="rounded"]').length > 0||$('.sharing-default-minimal a.linkedin-share').length > 0){
completed++;
socialFade();
}
if($('a.pinterest-share:not(.sharing-default-minimal a.pinterest-share)').length > 0&&$('body[data-button-style="rounded"]').length==0||$('#project-meta a.pinterest-share').length > 0||$('#single-meta a.pinterest-share').length > 0||$('#single-below-header .pinterest-share').length > 0){
$.getJSON('https://api.pinterest.com/v1/urls/count.json?url='+windowLocation+'&callback=?', function(data){
if((data.count!=0)&&(data.count!=undefined)&&(data.count!=null)){
$('.pinterest-share a span.count, a.pinterest-share span.count').html(data.count);
}else{
$('.pinterest-share a span.count, a.pinterest-share span.count').html(0);
}
completed++;
socialFade();
});
}else if($('a.pinterest-share').length > 0&&$('body[data-button-style="rounded"]').length > 0||$('.sharing-default-minimal a.pinterest-share').length > 0){
completed++;
socialFade();
}
$('a.nectar-sharing > span.count, a.nectar-sharing-alt > span.count').hide().css('width','auto');
$('.nectar-social').each(function(){
if($(this).parents('.custom-content').length==0){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
$slide_timeout=($('#page-header-bg[data-animate-in-effect="slide-down"] .nectar-social').length > 0) ? 900:1;
setTimeout(function(){
$that.addClass('in-sight');
socialFade();
if($('#page-header-bg .nectar-social').length==0){
$that.find('> *').each(function(i){
var $that=$(this);
var $timeout=($('body[data-button-style="rounded"]').length > 0) ? 0: 750;
setTimeout(function(){
$that.delay(i*80).queue(function(){
var $that=$(this); $(this).addClass('hovered');
setTimeout(function(){
$that.removeClass('hovered');
},300);
});
},$timeout);
});
}},$slide_timeout);
$that.addClass('animated-in');
waypoint.destroy();
},
offset: 'bottom-in-view'
});
}});
}}
socialSharingInit();
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
var $socialTimeout;
$('body').on('mouseenter','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){
clearTimeout($socialTimeout);
if($(this).parents('[id*="single-meta"]').length > 0&&$('[data-tab-pos="fullwidth"]').length==0)
$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'right':'0px'},0);
else
$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'left':'0px'},0);
$(this).parents('[id*="-meta"]').addClass('social-hovered');
$(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':0},250);
$(this).find('.nectar-social a').each(function(i){
$(this).stop(true).delay(i*40).animate({'opacity': 1, 'left':'0px'}, 150);
});
});
$('body').on('mouseleave','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){
$(this).parents('[id*="-meta"]').removeClass('social-hovered');
if($(this).parents('[id*="single-meta"]').length > 0&&$('[data-tab-pos="fullwidth"]').length==0)
$(this).find('.nectar-social').stop(true).animate({'opacity': 0, 'right':'-20px'}, 200);
else
$(this).find('.nectar-social').stop(true).animate({'opacity': 0, 'left':'-20px'}, 200);
$(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':1},250);
var $that=$(this);
$socialTimeout=setTimeout(function(){
$that.find('.nectar-social').hide();
if($that.parents('[id*="single-meta"]').length > 0&&$('[data-tab-pos="fullwidth"]').length==0)
$that.find('.nectar-social a').stop(true).animate({'opacity': 0, 'left':'20px'},0);
else
$that.find('.nectar-social a').stop(true).animate({'opacity': 0, 'left':'-20px'},0);
}, 200);
});
}else{
var $socialTimeout;
$('body').on('click','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){
clearTimeout($socialTimeout);
if($(this).parents('[id*="single-meta"]').length > 0&&$('[data-tab-pos="fullwidth"]').length==0)
$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'right':'0px'},0);
else
$(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'left':'0px'},0);
$(this).parents('[id*="-meta"]').addClass('social-hovered');
$(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':0},250);
$(this).find('.nectar-social a').each(function(i){
$(this).stop(true).delay(i*40).animate({'opacity': 1, 'left':'0px'}, 150);
});
return false;
});
}
$('body').on('mouseenter','.fullscreen-header .meta-share-count', function(){
$(this).find('> a, > i').stop(true).animate({'opacity': 0},400);
$(this).find('.nectar-social > *').each(function(i){
$(this).stop(true).delay(i*50).animate({'opacity':'1', 'top': '0px'},250,'easeOutCubic');
});
setTimeout(function(){ $('.meta-share-count .nectar-sharing, .meta-share-count .nectar-sharing-alt').removeClass('inactive'); },300);
});
if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
$('body').on('mouseleave','.fullscreen-header .meta-share-count', function(){
$(this).find('> a, > i').stop(true).animate({'opacity': 1},300,'easeInCubic');
$(this).find('.nectar-social > *').each(function(i){
$(this).stop(true).animate({'opacity':'0', 'top': '10px'},200,'easeInCubic');
});
});
}
function nectarLoveFWCenter(){
$('.nectar-social.full-width').each(function(){
$(this).find('.n-shortcode .nectar-love').css('padding-top', $(this).find('> a').css('padding-top'));
});
}
nectarLoveFWCenter();
$('body').on('click','.nectar-love', function(){
var $loveLink=$(this);
var $id=$(this).attr('id');
var $that=$(this);
if($loveLink.hasClass('loved')) return false;
if($(this).hasClass('inactive')) return false;
var $dataToPass={
action: 'nectar-love',
loves_id: $id,
love_nonce: nectarLove.loveNonce
}
$.post(nectarLove.ajaxurl, $dataToPass, function(data){
$loveLink.find('span').html(data);
$loveLink.addClass('loved').attr('title','You already love this!');
$loveLink.find('span').css({'opacity': 1,'width':'auto'});
if($('body').hasClass('ascend')&&$that.parents('.classic_enhanced').length==0){
$loveLink.find('.icon-salient-heart.loved').show().transition({ scale: 1 },800,'cubic-bezier(0.15, 0.84, 0.35, 1.5)');
setTimeout(function(){ $loveLink.find('.icon-salient-heart-2').css('opacity','0'); },400);
if($loveLink.parents('.sharing-default-minimal').length > 0&&$loveLink.parents('.bottom-meta').length >0) $loveLink.find('.icon-salient-heart-2').remove();
}else if($that.parents('.classic_enhanced').length > 0){
$that.find('.icon-salient-heart-2').addClass('loved');
}});
$(this).addClass('inactive');
return false;
});
function infiniteScrollInit(){
if($('.infinite_scroll').length > 0){
$('.portfolio-items.infinite_scroll').infinitescroll({
navSelector:"div#pagination",
nextSelector:"div#pagination a:first",
itemSelector:".portfolio-items.infinite_scroll .element",
finishedMsg: "Congratulations, you've reached the end of the internet.",
msgText: " ",
},function(newElements){
var $container=$('.portfolio-items.infinite_scroll:not(.carousel)');
var $newElems=$(newElements).css('opacity',0);
$newElems.imagesLoaded(function(){
$(newElements).css('opacity',1);
$container.isotope('appended', $(newElements));
$(newElements).find('.work-item').addClass('ajax-loaded');
$(newElements).addClass('ajax-loaded');
$(newElements).find('.work-meta, .nectar-love-wrap').css({'opacity':1});
if($('.portfolio-filters-inline').length > 0||$('.portfolio-filters').length > 0){
if($('.portfolio-filters-inline').length > 0){
var selector=$('.portfolio-filters-inline a.active').attr('data-filter');
}else{
var selector=$('.portfolio-filters a.active').attr('data-filter');
}
$('.portfolio-filters-inline a.active').attr('data-filter');
$container.isotope({ filter: selector });
}
portfolioItemWidths();
reLayout();
if($(newElements).find('.work-item.style-5').length > 0) style6Img();
if($(newElements).find('.inner-wrap').attr('data-animation')=='none'){
$('.portfolio-items .col .inner-wrap').removeClass('animated');
}else{
$(newElements).each(function(i){
$(this).delay(130*i).queue(function(next){
$(this).addClass("animated-in");
next();
});
});
}
portfolioHoverEffects();
portfolioAccentColor();
if($smoothCache==true&&$(window).width() > 690&&$('body').outerHeight(true) > $(window).height()&&Modernizr.csstransforms3d&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ niceScrollInit(); $(window).trigger('resize') }
if(!$('body').hasClass('mobile')&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
$(".portfolio-items:not(.carousel) .work-item.style-3 img").panr({
scaleDuration: .28
});
$(".portfolio-items:not(.carousel) .work-item.style-3-alt img").panr({ scaleDuration: .28, sensitivity: 12.6, scaleTo: 1.08, panDuration: 3 });
}
$('.portfolio-items').each(function(){
var $unique_id=Math.floor(Math.random()*10000);
$(this).find('a[rel^="prettyPhoto"], a.pretty_photo').attr('rel','prettyPhoto['+$unique_id+'_gal]').removeClass('pretty_photo');
});
lightBoxInit();
piVertCenter();
setTimeout(function(){masonryZindex(); reLayout(); $(newElements).removeClass('ajax-loaded'); },700);
isotopeCatSelection();
parallaxRowsBGCals();
});
});
$('#post-area.infinite_scroll .posts-container').infinitescroll({
navSelector:"div#pagination",
nextSelector:"div#pagination a:first",
itemSelector:"#post-area .posts-container .post",
finishedMsg: "Congratulations, you've reached the end of the internet.",
msgText: " "
},function(newElements){
if($('.masonry.meta_overlaid').length==0){
centerLove();
$(newElements).find('.flex-gallery').each(function(){
var $that=$(this);
$that.flexslider({
animation: 'fade',
smoothHeight: false,
animationSpeed: 500,
useCSS: false,
touch: true
});
$('.flex-gallery .flex-direction-nav li a.flex-next').html('');
$('.flex-gallery .flex-direction-nav li a.flex-prev').html('');
});
if($().mediaelementplayer) $(newElements).find('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer();
lightBoxInit();
if($('.carousel').length > 0){
standardCarouselInit();
clientsCarouselInit();
}
showLateIframes();
$(newElements).find('.nectar-milestone').each(function(){
if($(this).has('[data-symbol]')){
if($(this).attr('data-symbol-pos')=='before'){
$(this).find('.number').prepend($(this).attr('data-symbol'));
}else{
$(this).find('.number').append($(this).attr('data-symbol'));
}}
});
if(!$('body').hasClass('mobile')){
$(newElements).find('.nectar-milestone').each(function(){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
var $endNum=parseInt($that.find('.number span').text());
$that.find('.number span').countTo({
from: 0,
to: $endNum,
speed: 1500,
refreshInterval: 30
});
$that.addClass('animated-in');
waypoint.destroy();
},
offset: 'bottom-in-view'
});
});
}
if($().vcChat) $(newElements).find('.vc_pie_chart').vcChat();
nectar_fancy_ul_init();
$('.testimonial_slider').animate({'opacity':'1'},800);
createTestimonialControls();
testimonialSliderHeight();
testimonialHeightResize();
$(newElements).find('.nectar-progress-bar').each(function(i){
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
var percent=$that.find('span').attr('data-width');
var $endNum=parseInt($that.find('span strong i').text());
$that.find('span').transition({
'width':percent + '%'
},1600, 'easeInOutCirc',function(){
});
$that.find('span strong').transition({
'opacity':1
},1350);
$that.find('span strong i').countTo({
from: 0,
to: $endNum,
speed: 1100,
refreshInterval: 30,
onComplete: function(){
}});
if(percent=='100'){
$that.find('span strong').addClass('full');
}
$that.addClass('animated-in');
waypoint.destroy();
},
offset: 'bottom-in-view'
});
});
colAndImgAnimations();
splitLineHeadings();
setTimeout(function(){
videoshortcodeSize();
responsiveVideoIframesInit();
responsiveVideoIframes();
$(window).trigger('resize');
},500);
parallaxRowsBGCals();
$(window).trigger('resize');
}else{
parallaxRowsBGCals();
$(window).trigger('resize');
}
var $container=$('.posts-container');
if($container.parent().hasClass('masonry')){
$(newElements).addClass('masonry-blog-item');
$(newElements).prepend('');
$(newElements).each(function(){
var $metaClone=$(this).find('.post-meta').clone();
$(this).find('.post-meta').remove();
if($('#post-area.meta_overlaid').length > 0){
$(this).find('.post-header h2').after($metaClone);
}else{
$(this).find('.content-inner').after($metaClone);
}});
}
var $newElems=$(newElements);
if($newElems.find('img').length==0) $newElems=$('body');
$newElems.imagesLoaded(function(){
$container.isotope('appended', $(newElements));
flickityBlogInit();
$(newElements).addClass('ajax-loaded');
if($container.parent().hasClass('classic_enhanced')){
$container.find('.large_featured.has-post-thumbnail.ajax-loaded .post-featured-img, .wide_tall.has-post-thumbnail.ajax-loaded .post-featured-img').each(function(){
var $src=$(this).find('img').attr('src');
$(this).css('background-image','url('+$src+')');
});
$container.find('.large_featured.ajax-loaded .nectar-flickity, .wide_tall.ajax-loaded .nectar-flickity').each(function(){
$(this).find('.cell').each(function(){
var $src=$(this).find('img').attr('src');
$(this).css('background-image','url('+$src+')');
});
});
}
if($(newElements).parents('.posts-container').attr('data-animation')=='none'){
$(newElements).find('.inner-wrap').removeClass('animated');
}else{
$(newElements).each(function(i){
$(this).delay(130*i).queue(function(next){
$(this).addClass("animated-in");
next();
});
});
}
setTimeout(function(){$(newElements).removeClass('ajax-loaded'); },700);
});
});
}}
infiniteScrollInit();
function destroyInfiniteScroll(){
$('#post-area.infinite_scroll .posts-container').infinitescroll('destroy');
$('.portfolio-items.infinite_scroll').infinitescroll('destroy');
}
var $scrollTop=$(window).scrollTop();
function toTopBind(){
if($('#to-top').length > 0&&$(window).width() > 1020||$('#to-top').length > 0&&$('#to-top.mobile-enabled').length > 0){
if($scrollTop > 350){
$(window).on('scroll',hideToTop);
}else{
$(window).on('scroll',showToTop);
}}
}
toTopBind();
function showToTop(){
if($scrollTop > 350&&$('#slide-out-widget-area.fullscreen.open').length==0){
$('#to-top').stop().transition({
'bottom':'17px'
},350,'easeInOutCubic');
$(window).off('scroll',showToTop);
$(window).on('scroll',hideToTop);
}}
function hideToTop(){
if($scrollTop < 350||$('#slide-out-widget-area.fullscreen.open').length > 0){
$animationTiming=($('#slide-out-widget-area.fullscreen.open').length > 0) ? 1150:350;
$('#to-top').stop().transition({
'bottom':'-30px'
},$animationTiming,'easeInOutQuint');
$(window).off('scroll',hideToTop);
$(window).on('scroll',showToTop);
}}
if($('#to-top').length > 0){
var $windowHeight, $pageHeight, $footerHeight, $ctaHeight;
function calcToTopColor(){
$scrollTop=$(window).scrollTop();
$windowHeight=$(window).height();
$pageHeight=$('body').height();
$footerHeight=$('#footer-outer').height();
$ctaHeight=($('#call-to-action').length > 0) ? $('#call-to-action').height():0;
if(($scrollTop-35 + $windowHeight) >=($pageHeight - $footerHeight)&&$('#boxed').length==0){
$('#to-top').addClass('dark');
}else{
$('#to-top').removeClass('dark');
}}
$(window).scroll(calcToTopColor);
$(window).resize(calcToTopColor);
}
if($('body[data-button-style="rounded"]').length > 0){
var $clone=$('#to-top .icon-angle-up').clone();
$clone.addClass('top-icon');
$('#to-top').prepend($clone)
}
$('body').on('click','#to-top, a[href="#top"]',function(){
$('body,html').stop().animate({
scrollTop:0
},800,'easeOutQuad',function(){
if($('.nectar-box-roll').length > 0){
$('body').trigger('mousewheel', [1, 0, 0]);
}})
return false;
});
function scrollSpyInit(){
$("#header-outer a[href*='" + location.pathname + "']").each(function(){
var $href=$(this).attr('href');
if($href.indexOf("#")!=-1&&$('div'+$href.substr($href.indexOf("#"))).length > 0){
$(this).attr('href',$href.substr($href.indexOf("#")));
$(this).parent().removeClass('current_page_item').removeClass('current-menu-item');
}});
$target=($('.page-submenu[data-sticky="true"]').length==0) ? '#header-outer nav': '.page-submenu';
$('body').scrollspy({
target: $target,
offset: $('#header-outer').height() + adminBarHeight + 40
});
}
function pageLoadHash(){
var $hash=window.location.hash;
if($hash&&$($hash).length > 0){
$timeoutVar=0;
if($('.nectar-box-roll').length > 0&&$('.container-wrap.bottomBoxOut').length > 0){
boxRoll(null,-1);
$timeoutVar=2050;
}
setTimeout(function(){
if($('body[data-permanent-transparent="1"]').length==0){
if(!$('body').hasClass('mobile')){
$resize=($('#header-outer[data-header-resize="0"]').length > 0) ? 0:parseInt(shrinkNum) + headerPadding2*2;
var $scrollTopDistance=$($hash).offset().top - parseInt($('#header-space').height()) +$resize + 3 - adminBarHeight;
}else{
var $scrollTopDistance=($('#header-outer[data-mobile-fixed="1"]').length > 0) ? $($hash).offset().top + 2 - $('#header-space').height() + adminBarHeight:$($hash).offset().top - adminBarHeight + 1;
}}else{
var $scrollTopDistance=$($hash).offset().top - adminBarHeight + 1;
}
if($('body[data-hhun="1"]').length > 0){
if($('#header-outer.detached').length==0)
$scrollTopDistance=$scrollTopDistance + $('#header-space').height();
}
var $pageSubMenu=($('.page-submenu[data-sticky="true"]').length > 0) ? $('.page-submenu').height():0;
$('body,html').stop().animate({
scrollTop: $scrollTopDistance - $pageSubMenu
},800,'easeInOutCubic');
},$timeoutVar);
}}
if($('body[data-animated-anchors="true"]').length > 0){
+ function(t){
"use strict";
function s(e, i){
var r=t.proxy(this.process, this);
this.$body=t("body"), this.$scrollElement=t(t(e).is("body") ? window:e), this.options=t.extend({}, s.DEFAULTS, i), this.selector=(this.options.target||"") + " ul li > a", this.offsets=[], this.targets=[], this.activeTarget=null, this.scrollHeight=0, this.$scrollElement.on("scroll.bs.scrollspy", r), this.refresh(), this.process()
}
function e(e){
return this.each(function(){
var i=t(this),
r=i.data("bs.scrollspy"),
o="object"==typeof e&&e;
r||i.data("bs.scrollspy", r=new s(this, o)), "string"==typeof e&&r[e]()
})
}
s.VERSION="3.2.0", s.DEFAULTS={
offset: 10
}, s.prototype.getScrollHeight=function(){
return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
}, s.prototype.refresh=function(){
var s="offset",
e=0;
t.isWindow(this.$scrollElement[0])||(s="position", e=this.$scrollElement.scrollTop()), this.offsets=[], this.targets=[], this.scrollHeight=this.getScrollHeight();
var i=this;
this.$body.find(this.selector).map(function(){
var i=t(this),
r=i.data("target")||i.attr("href"),
o=/^#./.test(r)&&t(r);
return o&&o.length&&o.is(":visible")&&[
[o[s]().top + e, r]
]||null
}).sort(function(t, s){
return t[0] - s[0]
}).each(function(){
i.offsets.push(this[0]), i.targets.push(this[1])
})
}, s.prototype.process=function(){
var $pageSubMenu=($('.page-submenu[data-sticky="true"]').length > 0&&$('body[data-hhun="1"]').length==0) ? $('.page-submenu').height():0;
var t, s=this.$scrollElement.scrollTop() + this.options.offset + $pageSubMenu,
e=this.getScrollHeight(),
i=this.options.offset + e - this.$scrollElement.height() -$pageSubMenu,
r=this.offsets,
o=this.targets,
l=this.activeTarget;
if(this.scrollHeight!=e&&this.refresh(), s >=i) return l!=(t=o[o.length - 1])&&this.activate(t);
if(l&&s <=r[0]) return l!=(t=o[0])&&this.activate(t);
for (t=r.length; t--;) l!=o[t]&&s >=r[t]&&(!r[t + 1]||s <=r[t + 1])&&this.activate(o[t])
}, s.prototype.activate=function(s){
this.activeTarget=s, t(this.selector).parentsUntil(this.options.target, ".current-menu-item").removeClass("current-menu-item").removeClass('sfHover');
var e=this.selector + '[data-target="' + s + '"],' + this.selector + '[href="' + s + '"]',
i=t(e).parents("li").addClass("current-menu-item");
i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("current-menu-item")), i.trigger("activate.bs.scrollspy")
};
var i=t.fn.scrollspy;
t.fn.scrollspy=e, t.fn.scrollspy.Constructor=s, t.fn.scrollspy.noConflict=function(){
return t.fn.scrollspy=i, this
}}(jQuery);
var shrinkNum=6;
if($('#header-outer[data-shrink-num]').length > 0) shrinkNum=$('#header-outer').attr('data-shrink-num');
headerPadding2=headerPadding - headerPadding/1.8;
setTimeout(scrollSpyInit,200);
var $animatedScrollingTimeout;
$('body').on('click','#header-outer nav .sf-menu a, #footer-outer .nectar-button, .container-wrap a:not(.wpb_tabs_nav a):not(.woocommerce-tabs a), .swiper-slide .button a, #slide-out-widget-area a, #mobile-menu .container ul li a, #slide-out-widget-area .inner div a',function(e){
var $hash=$(this).prop("hash");
$('body').addClass('animated-scrolling');
clearTimeout($animatedScrollingTimeout);
$animatedScrollingTimeout=setTimeout(function(){ $('body').removeClass('animated-scrolling'); },850);
if($hash&&$($hash).length > 0&&$hash!='#top'&&$hash!=''&&$(this).attr('href').indexOf(window.location.href.split("#")[0])!==-1||$(this).is('[href^="#"]')&&$hash!=''&&$($hash).length > 0&&$hash!='#top'){
if(history.pushState){
history.pushState(null, null, $hash);
}else{
location.hash=$hash;
}
if($(this).parents('ul').length > 0){
$(this).parents('ul').find('li').removeClass('current-menu-item');
}
if($(this).parents('#slide-out-widget-area').length > 0){
$('#slide-out-widget-area .slide_out_area_close').trigger('click');
}
if($(this).parents('#mobile-menu').length > 0) $('#toggle-nav').trigger('click');
var $mobileMenuHeight=($(this).parents('#mobile-menu').length > 0) ? $(this).parents('#mobile-menu').height():null;
$timeoutVar=1;
if($('.nectar-box-roll').length > 0&&$('.container-wrap.bottomBoxOut').length > 0){
boxRoll(null,-1);
$timeoutVar=2050;
}
var $that=$(this);
setTimeout(function(){
var $headerSpace=($('body[data-permanent-transparent="1"]').length > 0) ? 0:parseInt($('#header-space').height());
if($('body[data-permanent-transparent="1"]').length==0){
if(!$('body').hasClass('mobile')){
$resize=($('#header-outer[data-header-resize="0"]').length > 0) ? 0:parseInt(shrinkNum) + headerPadding2*2;
var $scrollTopDistance=$($hash).offset().top - $mobileMenuHeight - parseInt($('#header-space').height()) +$resize + 3 - adminBarHeight;
}else{
var $scrollTopDistance=($('#header-outer[data-mobile-fixed="1"]').length > 0) ? $($hash).offset().top + 2 - $('#header-space').height() + adminBarHeight:$($hash).offset().top - $mobileMenuHeight - adminBarHeight + 1;
}}else{
var $scrollTopDistance=$($hash).offset().top - adminBarHeight + 1;
}
if($('body[data-hhun="1"]').length > 0){
if($('#header-outer.detached').length==0||$that.parents('.page-submenu[data-sticky="true"]').length > 0)
$scrollTopDistance=$scrollTopDistance + $('#header-space').height();
if($that.parents('.page-submenu[data-sticky="true"]').length > 0){
$('#header-outer.detached').addClass('invisible');
$('.page-submenu').addClass('header-not-visible').css('transform','translateY(0px)');
}}
var $pageSubMenu=($that.parents('.page-submenu[data-sticky="true"]').length > 0) ? $that.parents('.page-submenu').height():0;
$('body,html').stop().animate({
scrollTop: $scrollTopDistance - $pageSubMenu
},800,'easeInOutCubic');
},$timeoutVar);
e.preventDefault();
}
if($hash=='#top'){
if($(this).parents('#slide-out-widget-area').length > 0){
$('#slide-out-widget-area .slide_out_area_close').trigger('click');
}}
});
if($('.nectar-box-roll').length==0&&$('#nectar_fullscreen_rows').length==0) $(window).load(pageLoadHash);
}
if($('.portfolio-items .col .style-3-alt').length > 0||$('.portfolio-items .col .style-3').length > 0||$('.portfolio-items .col .style-2').length > 0||$('.portfolio-items .col .style-5').length > 0){
var portfolioColorCss='';
$('.portfolio-items .col').each(function(){
$titleColor=$(this).attr('data-title-color');
$subTitleColor=$(this).attr('data-subtitle-color');
if($titleColor.length > 0) portfolioColorCss +='.col[data-title-color="'+$titleColor+'"] .vert-center h3, .portfolio-items[data-ps="6"] .col[data-title-color="'+$titleColor+'"] .work-meta h4 { color: '+$titleColor+'; } ';
if($subTitleColor.length > 0) portfolioColorCss +='.col[data-subtitle-color="'+$subTitleColor+'"] .vert-center p, .portfolio-items[data-ps="6"] .col[data-title-color="'+$titleColor+'"] .work-meta p { color: '+$subTitleColor+'; } ';
});
var head=document.head||document.getElementsByTagName('head')[0];
var style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=portfolioColorCss;
}else{
style.appendChild(document.createTextNode(portfolioColorCss));
}
head.appendChild(style);
}
var $portfolio_containers=[];
$('.portfolio-items:not(.carousel)').each(function(i){
$portfolio_containers[i]=$(this);
});
function masonryPortfolioInit(){
$portfolio_containers=[];
$('.portfolio-items:not(.carousel)').each(function(i){
$portfolio_containers[i]=$(this);
});
var $window=jQuery(window);
$.each($portfolio_containers,function(i){
$portfolio_containers[i].imagesLoaded(function(){
if($smoothCache==true&&$(window).width() > 690&&$('body').outerHeight(true) > $(window).height()&&Modernizr.csstransforms3d&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ niceScrollInit(); $(window).trigger('resize') }
var $isoUseTransforms=true;
if(!$('body').hasClass('mobile')&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){
$(".portfolio-items:not(.carousel) .work-item.style-3 img").panr({ scaleDuration: .28 });
$(".portfolio-items:not(.carousel) .work-item.style-3-alt img").panr({ scaleDuration: .28, sensitivity: 20, scaleTo: 1.12, panDuration: 1 });
$isoUseTransforms=true;
}
piVertCenter();
var $layoutMode=($portfolio_containers[i].hasClass('masonry-items')) ? 'packery':'fitRows';
var $startingFilter=($portfolio_containers[i].attr('data-starting-filter')!=''&&$portfolio_containers[i].attr('data-starting-filter')!='default') ? '.' + $portfolio_containers[i].attr('data-starting-filter'):'*';
reLayout();
$portfolio_containers[i].isotope({
itemSelector:'.element',
filter: $startingFilter,
layoutMode: $layoutMode,
transitionDuration: '0.6s',
packery: {
gutter: 0
}}).isotope('layout');
if($startingFilter!='*'){
$('.portfolio-filters ul a[data-filter="'+$startingFilter+'"], .portfolio-filters-inline ul a[data-filter="'+$startingFilter+'"]').click();
}
masonryZindex();
setTimeout(function(){masonryZindex(); },800);
$window.resize(reLayout);
$window.smartresize(function(){
setTimeout(masonryZindex,700);
});
if($portfolio_containers[i].parents('.full-width-content').length > 0){ setTimeout(function(){ fullWidthContentColumns(); },200); }
$('.portfolio-loading').stop(true,true).fadeOut(200);
if($portfolio_containers[i].find('.inner-wrap').attr('data-animation')=='none'){
$('.portfolio-items .col .inner-wrap').removeClass('animated');
}else{
portfolioLoadIn();
}});
});
}
masonryPortfolioInit();
function portfolioLoadIn(){
$($fullscreenSelector+'.portfolio-items').each(function(){
$portfolioOffsetPos=($('#nectar_fullscreen_rows').length > 0) ? '100%':'90%';
if($(this).find('.inner-wrap').attr('data-animation')=='none') return;
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
if($that.parents('.wpb_tab').length > 0&&$that.parents('.wpb_tab').css('visibility')=='hidden'||$that.hasClass('animated-in')){
waypoint.destroy();
return;
}
$that.find('.col').each(function(i){
$(this).delay(130*i).queue(function(next){
$(this).addClass("animated-in");
next();
});
});
waypoint.destroy();
},
offset: $portfolioOffsetPos
});
});
}
var mediaQuerySize;
function reLayout(){
clearTimeout(clearIsoAnimation);
$('.portfolio-items .col').addClass('no-transition');
clearIsoAnimation=setTimeout(function(){ $('.portfolio-items .col').removeClass('no-transition'); },700);
var windowSize=$window.width();
var masonryObj;
var masonryObjHolder=[];
var userDefinedColWidth;
$.each($portfolio_containers,function(i){
if($portfolio_containers[i].attr('data-user-defined-cols')=='span4'){
userDefinedColWidth=3
}
else if($portfolio_containers[i].attr('data-user-defined-cols')=='span3'){
userDefinedColWidth=4
}
var isFullWidth=$portfolio_containers[i].attr('data-col-num')=='elastic';
if(window.innerWidth > 1600){
if($portfolio_containers[i].hasClass('constrain-max-cols')){
mediaQuerySize='four';
}else{
mediaQuerySize='five';
}}else if(window.innerWidth <=1600&&window.innerWidth > 1300){
mediaQuerySize='four';
}else if(window.innerWidth <=1300&&window.innerWidth > 990){
if($portfolio_containers[i].hasClass('constrain-max-cols')){
mediaQuerySize='four';
}else{
mediaQuerySize='three';
}}else if(window.innerWidth <=990&&window.innerWidth > 470){
mediaQuerySize='two';
}else if(window.innerWidth <=470){
mediaQuerySize='one';
}
if($('#boxed').length > 0){
if(window.innerWidth > 1300){
mediaQuerySize='four';
}else if(window.innerWidth < 1300&&window.innerWidth > 990){
if($portfolio_containers[i].hasClass('constrain-max-cols')){
mediaQuerySize='four';
}else{
mediaQuerySize='three';
}}else if(window.innerWidth < 990){
mediaQuerySize='one';
}}
switch (mediaQuerySize){
case 'five':
(isFullWidth) ? colWidth=5:colWidth=userDefinedColWidth;
masonryObj={ columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) };
break;
case 'four':
(isFullWidth) ? colWidth=4:colWidth=userDefinedColWidth;
masonryObj={ columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) };
break;
case 'three':
(isFullWidth) ? colWidth=3:colWidth=userDefinedColWidth;
masonryObj={ columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) };
break;
case 'two':
masonryObj={ columnWidth: Math.floor($portfolio_containers[i].width() / 2) };
break;
case 'one':
masonryObj={ columnWidth: Math.floor($portfolio_containers[i].width() / 1) };
break;
}
portfolioItemWidths();
if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible').length > 0||$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="wide"]:first:visible').length > 0||$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"]:first:visible').length > 0||$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="wide_tall"]:first:visible').length > 0){
var multipler=(window.innerWidth > 470) ? 2:1;
$itemClassForSizing='regular';
if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible').length==0&&$portfolio_containers[i].find('.col.elastic-portfolio-item.wide:first:visible').length > 0){
$itemClassForSizing='wide';
}else if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible').length==0&&$portfolio_containers[i].find('.col.elastic-portfolio-item.wide_tall:first:visible').length > 0){
$itemClassForSizing='wide_tall';
multipler=1;
}else if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible').length==0&&$portfolio_containers[i].find('.col.elastic-portfolio-item.tall:first:visible').length > 0){
$itemClassForSizing='tall';
multipler=1;
}
$portfolio_containers[i].find('.col.elastic-portfolio-item.'+$itemClassForSizing+' img').css('height','auto');
var tallColHeight=$portfolio_containers[i].find('.col.elastic-portfolio-item.'+$itemClassForSizing+':first:visible img').height();
$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] img, .col.elastic-portfolio-item.wide img, .col.elastic-portfolio-item.regular img').removeClass('auto-height');
$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] img:not(.custom-thumbnail)').css('height',(tallColHeight*multipler));
$portfolio_containers[i].find('.col.elastic-portfolio-item.wide img:not(.custom-thumbnail), .col.elastic-portfolio-item.regular img:not(.custom-thumbnail)').css('height',tallColHeight);
$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] .parallaxImg').css('height',(tallColHeight*multipler) + parseInt($portfolio_containers[i].find('.col.elastic-portfolio-item').css('padding-bottom'))*2);
$portfolio_containers[i].find('.col.elastic-portfolio-item.regular .parallaxImg, .col.elastic-portfolio-item.wide .parallaxImg').css('height',tallColHeight);
}else{
$portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] img, .col.elastic-portfolio-item.wide img, .col.elastic-portfolio-item.regular img').addClass('auto-height');
}
if($portfolio_containers[i].hasClass('no-masonry')&&$portfolio_containers[i].find('.col:first:visible').length > 0&&$portfolio_containers[i].parents('.wpb_gallery').length==0){
$portfolio_containers[i].find('.col img').css('height','auto');
var tallColHeight=$portfolio_containers[i].find('.col:first:visible img').height();
$portfolio_containers[i].find('.col img:not(.custom-thumbnail)').css('height',tallColHeight);
$portfolio_containers[i].find('.col .parallaxImg').css('height',tallColHeight);
}
masonryObjHolder[i]=masonryObj;
if($portfolio_containers[i].isotope()) $portfolio_containers[i].isotope('layout');
});
}
function portfolioItemWidths(){
$.each($portfolio_containers,function(i,v){
var $colSize=4;
var $mult=(mediaQuerySize=='one') ? 1:2;
if(mediaQuerySize=='five') $colSize=5;
if(mediaQuerySize=='four') $colSize=4;
if(mediaQuerySize=='three') $colSize=3;
if(mediaQuerySize=='two') $colSize=2;
if(mediaQuerySize=='one') $colSize=1;
if($(v).is('[data-ps="6"]')&&$colSize==5) $colSize=4;
if($(v).width() % $colSize==0){
$(v).find('.elastic-portfolio-item:not(.wide):not(.wide_tall)').css('width',Math.floor($(v).width()/$colSize) +'px');
$(v).find('.elastic-portfolio-item.wide, .elastic-portfolio-item.wide_tall').css('width',Math.floor($(v).width()/$colSize*$mult) +'px');
}else{
for(var i=1; i<4; i++){
if(($(v).width() - i) % $colSize==0){
$(v).find('.elastic-portfolio-item:not(.wide):not(.wide_tall)').css('width',($(v).width()- i)/$colSize +'px');
$(v).find('.elastic-portfolio-item.wide, .elastic-portfolio-item.wide_tall').css('width',($(v).width()-i)/$colSize*$mult +'px');
}}
}});
}
function masonryZindex(){
if($('body .portfolio-items:not(".carousel") .elastic-portfolio-item').css('left')){
var $coords={};
var $zindexRelation={};
$('body .portfolio-items:not(".carousel") .elastic-portfolio-item').each(function(){
$(this).css('z-index',Math.abs(Math.floor($(this).offset().left/20)));
});
/*var $corrdsArr=$.map($coords, function (value){ return value; });
$corrdsArr=removeDuplicates($corrdsArr);
$corrdsArr.sort(function(a,b){return a-b});
for(var i=0; i < $corrdsArr.length; i++){
$zindexRelation[$corrdsArr[i]]=i*10;
}
$.each($coords,function(k,v){
var $zindex;
var $coordCache=v;
$.each($zindexRelation,function(k,v){
if($coordCache==k){
$zindex=v;
}});
$('body .portfolio-items:not(".carousel") .elastic-portfolio-item:eq('+k+')').css('z-index',$zindex);
});*/
}}
function blogMasonryZindex(){
if($('body .masonry.meta_overlaid .masonry-blog-item').css('left')){
var $coords={};
var $zindexRelation={};
$('body .masonry.meta_overlaid .masonry-blog-item').each(function(){
$coords[$(this).index()]=$(this).css('left').substring(0, $(this).css('left').length - 2);
});
var $corrdsArr=$.map($coords, function (value){ return value; });
$corrdsArr=removeDuplicates($corrdsArr);
$corrdsArr.sort(function(a,b){return a-b});
for(var i=0; i < $corrdsArr.length; i++){
$zindexRelation[$corrdsArr[i]]=i*10;
}
$.each($coords,function(k,v){
var $zindex;
var $coordCache=v;
$.each($zindexRelation,function(k,v){
if($coordCache==k){
$zindex=v;
}});
$('body .masonry.meta_overlaid .masonry-blog-item:eq('+k+')').css('z-index',$zindex);
});
}}
function matrixToArray(matrix){
return matrix.substr(7, matrix.length - 8).split(', ');
}
function removeDuplicates(inputArray){
var i;
var len=inputArray.length;
var outputArray=[];
var temp={};
for (i=0; i < len; i++){
temp[inputArray[i]]=0;
}
for (i in temp){
outputArray.push(i);
}
return outputArray;
}
var clearIsoAnimation=null;
var $checkForScrollBar=null;
$('.portfolio-items:not(".carousel")').each(function(i){
$(this).attr('instance',i);
$(this).parent().parent().find('div[class^=portfolio-filters]').attr('instance',i);
});
function isoClickFilter(){
var $timeout;
if(window.innerWidth > 690&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
/*clearInterval($checkForScrollBar);
if($('html').outerHeight(true) > $(window).height()){
$checkForScrollBar=null;
$checkForScrollBar=setInterval(function(){
if($('body').height() <=$(window).height()){
fullWidthSections();
$(window).trigger('resize');
clearInterval($checkForScrollBar);
}},40);
}else{
$checkForScrollBar=null;
$checkForScrollBar=setInterval(function(){
if($('html').outerHeight(true) > $(window).height()){
fullWidthSections();
$(window).trigger('resize');
clearInterval($checkForScrollBar);
}},40);
}*/
/* clearTimeout(clearIsoAnimation);
$('.isotope, .isotope .isotope-item').css('transition-duration','0.7s');
clearIsoAnimation=setTimeout(function(){ $('.isotope, .isotope .isotope-item').css('transition-duration','0s'); },700); */
clearTimeout($timeout);
$timeout=setTimeout(function(){masonryZindex(); },600);
}
var selector=$(this).attr('data-filter');
var $instance=$(this).parents('div[class^=portfolio-filters]').attr('instance');
$.each($portfolio_containers,function(i){
if($portfolio_containers[i].attr('instance')==$instance) $portfolio_containers[i].isotope({ filter: selector }).attr('data-current-cat',selector);
});
$(this).parent().parent().find('li a').removeClass('active');
$(this).addClass('active');
if($('.portfolio-items a[rel^="prettyPhoto"]').length > 0){
setTimeout(updatePrettyPhotoGallery,170);
}else{
setTimeout(updateMagPrettyPhotoGallery,170);
}
return false;
}
$('body').on('click','.portfolio-filters ul li a, .portfolio-filters-inline ul li a', isoClickFilter);
function updatePrettyPhotoGallery(){
$('.portfolio-items').each(function(){
if($(this).find('a[rel^="prettyPhoto"]').length > 0){
var $unique_id=Math.floor(Math.random()*10000);
var $currentCat=$(this).attr('data-current-cat');
$(this).find('.col'+$currentCat).find('a[rel^="prettyPhoto"]').attr('rel','prettyPhoto['+$unique_id+'_sorted]');
}});
}
function updateMagPrettyPhotoGallery(){
$('.portfolio-items').each(function(){
var $currentCat=$(this).attr('data-current-cat');
$(this).find('.col').each(function(){
$(this).find('a.gallery').removeClass('gallery').removeClass('magnific');
if($(this).is($currentCat))
$(this).find('.work-info a').addClass('gallery').addClass('magnific');
});
});
}
function masonryBlogInit(){
var $posts_container=$('.posts-container')
if($posts_container.parent().hasClass('masonry')){
$posts_container.find('article').addClass('masonry-blog-item');
$posts_container.find('article').prepend('');
$posts_container.find('article').each(function(){
var $metaClone=$(this).find('.post-meta').clone();
$(this).find('.post-meta').remove();
if($('#post-area.meta_overlaid').length > 0){
$(this).find('.post-header h2').after($metaClone);
}else{
$(this).find('.content-inner').after($metaClone);
}});
if($posts_container.parent().hasClass('masonry')&&$posts_container.parent().hasClass('full-width-content')){
$posts_container.parent().wrap('
').removeClass('full-width-content').css({'margin-left':'0','width':'auto'});
if($posts_container.parents('.wpb_row').length > 0) $posts_container.parents('.wpb_row').css('z-index',100);
if($('.masonry.meta_overlaid').length==0){
if($('.masonry.classic_enhanced').length > 0){
$posts_container.parent().parents('.full-width-content').css({
'padding':'0px 0.2% 0px 2.4%'
});
}else{
$posts_container.parent().parents('.full-width-content').css({
'padding':'0px 0.2% 0px 3.2%'
});
}}else{
$posts_container.parent().parents('.full-width-content').addClass('meta-overlaid');
$('.container-wrap').addClass('meta_overlaid_blog');
}
fullWidthSections();
}
var $cols=3;
var $element=$posts_container;
if($posts_container.find('img').length==0) $element=$('');
imagesLoaded($element,function(instance){
if($('body').hasClass('mobile')||$('#post-area').hasClass('span_9')){
$cols=2;
}
if($posts_container.parent().hasClass('classic_enhanced')){
$posts_container.find('.large_featured.has-post-thumbnail .post-featured-img, .wide_tall.has-post-thumbnail .post-featured-img').each(function(){
var $src=$(this).find('img').attr('src');
$(this).css('background-image','url('+$src+')');
});
$posts_container.find('.large_featured .nectar-flickity, .wide_tall .nectar-flickity').each(function(){
$(this).find('.cell').each(function(){
var $src=$(this).find('img').attr('src');
$(this).css('background-image','url('+$src+')');
});
});
}
$cols=blogColumnNumbCalcs();
blogHeightCalcs($posts_container, $cols);
if($('#post-area.meta_overlaid').length > 0){
$posts_container.isotope({
itemSelector: 'article',
transitionDuration: '0s',
layoutMode: 'packery',
packery: {
gutter: 0
}}).isotope('layout');
}else{
if($posts_container.parent().hasClass('classic_enhanced')){
if($('.span_9.masonry').length==0){
$multiplier=(window.innerWidth >=1600) ? .015 : .02;
}else{
$multiplier=.04;
}}else{
$multiplier=($('.span_9.masonry').length==0) ? .02: .04;
}
$posts_container.isotope({
itemSelector: 'article',
transitionDuration: '0s',
layoutMode: 'packery',
packery: {
gutter: $('#post-area').width()*$multiplier
}}).isotope('layout');
}
blogLoadIn();
flickityBlogInit();
$(window).trigger('resize');
blogMasonryZindex();
setTimeout(blogMasonryZindex,700);
$window.smartresize(function(){
setTimeout(blogMasonryZindex,700);
});
});
$(window).resize(function(){
$cols=blogColumnNumbCalcs();
blogHeightCalcs($posts_container, $cols);
if($('#post-area.meta_overlaid').length > 0){
$posts_container.isotope({
layoutMode: 'packery',
packery: {
gutter: 0
}});
}else{
if($posts_container.parent().hasClass('classic_enhanced')){
if($('.span_9.masonry').length==0){
$multiplier=(window.innerWidth >=1600) ? .015 : .02;
}else{
$multiplier=.04;
}}else{
$multiplier=($('.span_9.masonry').length==0) ? .02: .04;
}
$posts_container.isotope({
layoutMode: 'packery',
packery: {
gutter: $('#post-area').width()*$multiplier
}});
}});
}else{
blogLoadIn();
}}
masonryBlogInit();
function blogLoadIn(){
$('.posts-container').each(function(){
if($(this).attr('data-load-animation')=='none'){
$(this).find('.inner-wrap').removeClass('animated');
}else{
var $that=$(this);
var waypoint=new Waypoint({
element: $that,
handler: function(direction){
$that.find('article').each(function(i){
$(this).delay(130*i).queue(function(next){
$(this).addClass("animated-in");
next();
});
});
waypoint.destroy();
},
offset: '90%'
});
}});
}
function blogHeightCalcs($posts_container, cols){
if($posts_container.parent().hasClass('meta_overlaid')&&$posts_container.find('article[class*="regular"]').length > 0){
$.each($posts_container,function(i,v){
var $colSize=4;
var $mult=(cols==1) ? 1:2;
if($('html.no-csstransitions').length==0){
$(v).find('article[class*="regular"]').css('width',Math.floor($(v).width()/cols) +'px');
$(v).find('article[class*="tall"]').css('width',Math.floor($(v).width()/cols*$mult) +'px');
}else{
$('#post-area.masonry').css('width','100%');
}});
$posts_container.find('article[class*="regular"] img').css('height','auto');
var tallColHeight=Math.ceil($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote") img').first().height());
var multipler=(window.innerWidth > 470) ? 2:1 ;
$posts_container.find('article[class*="tall"] img, .article.wide img, article.regular img').removeClass('auto-height');
$posts_container.find('article[class*="tall"] img').css('height',(tallColHeight*multipler));
$posts_container.find('article[class*="regular"] img').css('height',(tallColHeight));
$posts_container.find('article.regular.format-link,article.regular.format-quote').each(function(){
if(window.innerWidth > 470){
$(this).css({
'height': tallColHeight
});
}else{
$(this).css({
'height': 'auto'
});
}});
}else{
$posts_container.find('article[class*="tall"] img, article.regular img').addClass('auto-height');
}
if($posts_container.parent().hasClass('classic_enhanced')&&$posts_container.find('article[class*="regular"]').length > 0){
if($(window).width() > 690)
classicEnhancedSizing($posts_container.find('article:not(.large_featured):not(.wide_tall)'));
else
classicEnhancedSizing($posts_container.find('article:not(.wide_tall)'));
var tallColHeight=($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote").has-post-thumbnail').first().length > 0) ? Math.ceil($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote").has-post-thumbnail').first().css('height','auto').height()):600;
if($(window).width() > 690)
$posts_container.find('article.large_featured, article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
else
$posts_container.find('article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
}else if($posts_container.parent().hasClass('classic_enhanced')&&$posts_container.find('article[class*="regular"]').length==0){
var tallColHeight=($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote").has-post-thumbnail').first().length > 0) ? Math.ceil($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote").has-post-thumbnail').first().css('height','auto').height()):600;
if($(window).width() > 690)
$posts_container.find('article.large_featured, article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
else
$posts_container.find('article.regular, article[class*="wide_tall"]').css('height',(tallColHeight));
}
if($('html.no-csstransitions').length > 0)
$('#post-area.masonry').css('width','100%');
}
function classicEnhancedSizing(elements){
var tallestCol=0;
elements.find('.article-content-wrap').css('height','auto');
elements.filter('.has-post-thumbnail').each(function(){
($(this).find('.article-content-wrap').outerHeight(true) > tallestCol) ? tallestCol=$(this).find('.article-content-wrap').outerHeight(true):tallestCol=tallestCol;
});
elements.filter('.has-post-thumbnail').find('.article-content-wrap').css('height',(tallestCol));
}
var blogMediaQuerySize;
function blogColumnNumbCalcs(){
if($('body').hasClass('mobile')&&window.innerWidth < 990||$('#post-area').hasClass('span_9')&&$('#post-area.meta_overlaid').length==0){
$cols=2;
}else if($('#post-area').hasClass('full-width-content')||$('#post-area').parent().hasClass('full-width-content')&&$('#boxed').length==0||$('#post-area.meta_overlaid').length > 0){
var windowSize=$(window).width();
if(window.innerWidth >=1600){
blogMediaQuerySize=($('#post-area.meta_overlaid').length > 0) ? 'four' :'five';
}else if(window.innerWidth < 1600&&window.innerWidth >=1300){
blogMediaQuerySize='four';
}else if(window.innerWidth < 1300&&window.innerWidth >=990){
blogMediaQuerySize=($('#post-area.meta_overlaid').length > 0) ? 'four' :'three';
}else if(window.innerWidth < 990&&window.innerWidth >=470){
blogMediaQuerySize='two';
}else if(window.innerWidth < 470){
blogMediaQuerySize=($('#post-area.meta_overlaid').length > 0) ? 'two' :'one';
}
if($('#boxed').length > 0){
if(window.innerWidth > 1300){
blogMediaQuerySize='four';
}else if(window.innerWidth < 1300&&window.innerWidth > 990){
blogMediaQuerySize=($('#post-area.meta_overlaid').length > 0) ? 'four' :'three';
}else if(window.innerWidth < 990){
blogMediaQuerySize=($('#post-area.meta_overlaid').length > 0) ? 'two' :'one';
}}
switch (blogMediaQuerySize){
case 'five':
$cols=5;
break;
case 'four':
$cols=4;
break;
case 'three':
$cols=3;
break;
case 'two':
$cols=2;
break;
case 'one':
$cols=1;
break;
}}else{
$cols=3;
}
return $cols;
}
var shrinkNum=6;
if($('#header-outer[data-shrink-num]').length > 0) shrinkNum=$('#header-outer').attr('data-shrink-num');
headerPadding2=headerPadding - headerPadding/1.8;
$('body').on('click','.section-down-arrow',function(){
if($(this).parents('.nectar-box-roll').length > 0) return false;
var $currentSection=$(this).parents('#page-header-bg');
var $topDistance=$currentSection.attr('data-height');
var $offset=($currentSection.parents('.first-section').length==0||$('body[data-transparent-header="false"]').length > 0) ? $currentSection.offset().top:0;
var $bodyBorderSize=($('.body-border-top').length > 0&&$(window).width() > 690) ? $('.body-border-top').height(): 0;
if($('body[data-permanent-transparent="1"]').length==0){
if(!$('body').hasClass('mobile')){
if($('body[data-hhun="1"]').length > 0){
$('body,html').stop().animate({
scrollTop: parseInt($topDistance) + $offset + 2 - $bodyBorderSize*2
},1000,'easeInOutCubic')
}else{
$resize=($('#header-outer[data-header-resize="0"]').length > 0) ? 0:parseInt(shrinkNum) + headerPadding2*2;
$('body,html').stop().animate({
scrollTop: parseInt($topDistance - $('#header-space').height()) +$resize + 3 + $offset
},1000,'easeInOutCubic')
}}else{
$scrollPos=($('#header-outer[data-mobile-fixed="1"]').length > 0) ? parseInt($topDistance) - $('#header-space').height() + parseInt($currentSection.offset().top) + 2:parseInt($topDistance) + parseInt($currentSection.offset().top) + 2;
$('body,html').stop().animate({
scrollTop: $scrollPos - $bodyBorderSize*2
},1000,'easeInOutCubic')
}}else{
$('body,html').stop().animate({
scrollTop: parseInt($topDistance) + parseInt($currentSection.offset().top) + 2 - $bodyBorderSize*2
},1000,'easeInOutCubic')
}
return false;
});
function crossBrowserFixes(){
if($("body").hasClass("single-portfolio")||$('body').hasClass("error404")||$('body').hasClass("search-results")){
$("li").removeClass("current_page_parent").removeClass("current-menu-ancestor").removeClass('current_page_ancestor');
}
$('.recent_projects_widget div a:nth-child(3n+3), #sidebar #flickr div:nth-child(3n+3) a, #footer-outer #flickr div:nth-child(3n+3) a').css('margin-right','0px');
$('code').find('br').remove();
if($('.container.main-content > .row > div:last-child').hasClass('clear')){
$('.container.main-content > .row > div:last-child').css('padding-bottom','0');
}
$('.container-wrap .blog-recent > div:last-child').addClass('col_last');
if($('.single .blog_next_prev_buttons').length > 0) $('.container-wrap').css('padding-bottom',0);
$('.wpcf7-form p:has(input[type=submit])').css('padding-bottom','0px');
$('.full-width-content .wpcf7-submit').on('click',function(){ setTimeout(function(){ fullWidthContentColumns() },1000); setTimeout(function(){ fullWidthContentColumns() },2000); });
$('#featured article').each(function(){
if($(this).find('h2').attr('data-has-caption')=='0'){
$(this).parents('.slide').addClass('no-caption');
}});
var ua=window.navigator.userAgent;
var msie=ua.indexOf("Edge/");
if(msie > 0)
$('body').addClass('msie');
$('.gform_body').click(function(){
setTimeout(function(){ fullWidthContentColumns(); },200);
});
$('article.post.format-chat .content-inner dt:odd').css('color','#333');
$('.full-width-section').each(function(){
$(this).find('> .span_12 > div.col_last').last().css('margin-bottom','0');
});
$('#portfolio-extra p').each(function(){
if($(this).find('*').length==1&&$(this).find('img').length==1){
$(this).find('img').unwrap();
}});
$('.vc_text_separator').each(function(){
if($(this).parents('.full-width-section').length > 0) $(this).find('div').css('background-color',$(this).parents('.full-width-section').find('.row-bg').css('background-color'));
});
$('.carousel-heading').each(function(){
if($(this).find('h2').length > 0) $(this).find('.carousel-prev, .carousel-next').css('top','7px');
});
$('.carousel-wrap').each(function(){
if($(this).find('.carousel-heading .container:empty').length > 0) $(this).find('.carousel-heading').remove();
});
$('.woocommerce div.product div.images div.thumbnails a:nth-child(4n+4)').css('margin-right','0px');
$('article.post .gallery-slider .gallery, article.post .gallery-slider .jetpack-slideshow, .single-portfolio .gallery-slider .gallery, .single-portfolio .gallery-slider .jetpack-slideshow').remove();
$('.woocommerce .span_9 .products.related .products li:nth-child(4), .woocommerce .span_9 .products.upsells .products li:nth-child(4)').remove();
$('.woocommerce .span_9 .products.related .products li:nth-child(3), .woocommerce .span_9 .products.upsells .products li:nth-child(3)').css('margin-right','0');
$('.cart-menu a, .widget_shopping_cart a').addClass('no-ajaxy');
$('div.clients').each(function(){
$(this).find('> div').each(function(){
if($(this).find('a').length==0){
$(this).addClass('no-link');
}});
});
if(nectarLove.disqusComments=='true') $('#post-area article a, .blog_next_prev_buttons a, #portfolio-nav #prev-link a, #portfolio-nav #next-link a, .portfolio-items .col .work-item .work-info a').addClass('no-ajaxy');
if($('.blog_next_prev_buttons').find('.bg-color-only-indicator').length > 0) $('.blog_next_prev_buttons').addClass('bg-color-only').find('.bg-color-only-indicator').remove();
if($('#single-below-header').hasClass('fullscreen-header')&&$('.blog_next_prev_buttons').length==0) $('#author-bio, .comment-wrap').addClass('lighter-grey');
if($('body.woocommerce').find('#page-header-bg').length > 0){
$('.container-wrap').css({'margin-top':'0px','padding-top':'30px'});
}
$('header#top nav .megamenu .sub-menu a.sf-with-ul .sf-sub-indicator').remove();
if($('.demo_store').length > 0) $('#header-outer, #header-space').css('margin-top','32px');
$('#footer-widgets .container .row > div:last-child').addClass('col_last');
$('.swiper-slide.external-button-1 .buttons > div:nth-child(1) a').attr('target','_blank');
$('.swiper-slide.external-button-2 .buttons > div:nth-child(2) a').attr('target','_blank');
$(".portfolio-items a[href*='http://']:not([href*='"+window.location.hostname+"']), .recent_projects_widget a[href*='http://']:not([href*='"+window.location.hostname+"'])").attr("target","_blank");
$('.container-wrap .row > .wpb_row').each(function(){
if($(this).find('> .span_12 > .wpb_column > .wpb_wrapper').length > 0&&$(this).find('> .span_12 > .wpb_column > .wpb_wrapper').find('*').length==0) $(this).find('> .span_12 ').remove();
});
$('.full-width-content .col.boxed').removeClass('boxed');
$('.full-width-content .wpb_column .nectar-slider-wrap[data-full-width="true"]').attr('data-full-width','false');
if($('.nectar-slider-wrap.first-section').length==0 &&
$('.full-width-section.first-section > .span_12 > .vc_span12 > .wpb_wrapper > .nectar-slider-wrap').length==0 &&
$('.parallax_slider_outer.first-section').length==0 &&
$('.full-width-content.first-section .wpb_wrapper > .nectar-slider-wrap').length==0 &&
!($('.wpb_row.first-section > .nectar-parallax-scene').length==1&&$('#header-outer[data-transparent-header="true"]').length==1)){
$('#header-outer .ns-loading-cover').remove();
}
var $tmpTitle=null;
$('.portfolio-items > .col a[title]').hover(function(){
$tmpTitle=$(this).attr('title');
$(this).attr('title',' ');
},function(){
$(this).attr('title', $tmpTitle);
});
$('.portfolio-items > .col a[title]').click(function(){
$(this).attr('title', $tmpTitle);
});
};
crossBrowserFixes();
function wooPriceSlider(){
if(typeof woocommerce_price_slider_params==='undefined'||!$('body').hasClass('woocommerce')){
return false;
}
$('input#min_price, input#max_price').hide();
$('.price_slider, .price_label').show();
var min_price=$('.price_slider_amount #min_price').data('min'),
max_price=$('.price_slider_amount #max_price').data('max');
current_min_price=parseInt(min_price, 10);
current_max_price=parseInt(max_price, 10);
if(woocommerce_price_slider_params.min_price) current_min_price=parseInt(woocommerce_price_slider_params.min_price, 10);
if(woocommerce_price_slider_params.max_price) current_max_price=parseInt(woocommerce_price_slider_params.max_price, 10);
$('body').bind('price_slider_create price_slider_slide', function(event, min, max){
if(woocommerce_price_slider_params.currency_pos==='left'){
$('.price_slider_amount span.from').html(woocommerce_price_slider_params.currency_symbol + min);
$('.price_slider_amount span.to').html(woocommerce_price_slider_params.currency_symbol + max);
}else if(woocommerce_price_slider_params.currency_pos==='left_space'){
$('.price_slider_amount span.from').html(woocommerce_price_slider_params.currency_symbol + " " + min);
$('.price_slider_amount span.to').html(woocommerce_price_slider_params.currency_symbol + " " + max);
}else if(woocommerce_price_slider_params.currency_pos==='right'){
$('.price_slider_amount span.from').html(min + woocommerce_price_slider_params.currency_symbol);
$('.price_slider_amount span.to').html(max + woocommerce_price_slider_params.currency_symbol);
}else if(woocommerce_price_slider_params.currency_pos==='right_space'){
$('.price_slider_amount span.from').html(min + " " + woocommerce_price_slider_params.currency_symbol);
$('.price_slider_amount span.to').html(max + " " + woocommerce_price_slider_params.currency_symbol);
}
$('body').trigger('price_slider_updated', min, max);
});
$('.price_slider').slider({
range: true,
animate: true,
min: min_price,
max: max_price,
values: [ current_min_price, current_max_price ],
create:function(event, ui){
$('.price_slider_amount #min_price').val(current_min_price);
$('.price_slider_amount #max_price').val(current_max_price);
$('body').trigger('price_slider_create', [ current_min_price, current_max_price ]);
},
slide: function(event, ui){
$('input#min_price').val(ui.values[0]);
$('input#max_price').val(ui.values[1]);
$('body').trigger('price_slider_slide', [ ui.values[0], ui.values[1] ]);
},
change: function(event, ui){
$('body').trigger('price_slider_change', [ ui.values[0], ui.values[1] ]);
},
});
}
function vcMobileColumns(){
$('.wpb_row').each(function(){
if(typeof $(this).find('.span_12').offset()!='undefined'){
$(this).find('[class*="vc_col-"]').each(function(){
var $firstChildOffset=$(this).parents('.span_12').offset().left;
$(this).removeClass('no-left-margin');
if($(this).offset().left < $firstChildOffset + 27){
$(this).addClass('no-left-margin');
}else{
$(this).removeClass('no-left-margin');
}});
}});
}
if($('[class*="vc_col-xs-"], [class*="vc_col-md-"], [class*="vc_col-lg-"]').length > 0) vcMobileColumns();
if($('body[data-form-style="minimal"]').length > 0){
function convertPlaceholders(){
$('form input[placeholder], form textarea[placeholder]').each(function(i){
if($(this).attr('placeholder').length > 1){
var $placeholder=$(this).attr('placeholder');
var $inputID=($(this).is('[id]')) ? $(this).attr('id'):'id-'+i;
if($(this).parents('.wpcf7-form-control-wrap').length==0){
if($(this).prev('label').length==0||$(this).is('textarea')){
$('').insertBefore($(this));
}}else{
if($(this).parents('.wpcf7-form-control-wrap').find('label').length==0){
$('').insertBefore($(this).parents('.wpcf7-form-control-wrap '));
}}
$(this).removeAttr('placeholder');
}});
}
convertPlaceholders();
setTimeout(convertPlaceholders,500);
$('#billing_country, #shipping_country, .country_to_state').on('change',function(){
convertPlaceholders();
removeExcessLabels();
var $wooDynamicPlaceholders=setInterval(function(){
convertPlaceholders();
convertToMinimalStyle('form label');
removeExcessLabels();
},30);
setTimeout(function(){ clearInterval($wooDynamicPlaceholders); },600);
});
function convertToMinimalStyle(selector){
$(selector).each(function(){
if($(this).parent().find('input:not([type="checkbox"]):not([type="hidden"]):not(#search-outer input):not(.adminbar-input):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="date"]):not([type="color"]):not([type="range"]):not([role="button"]):not([role="combobox"]):not(.select2-focusser)').length==1||$(this).parent().find('textarea').length==1){
if($(this).parents('.minimal-form-input').length==0){
if($(this).next('input').length==1){
$(this).next('input').andSelf().wrapAll('');
}else{
$(this).parent().wrapInner('');
}
$html=$(this).html();
$(this)[0].innerHTML=''+$html+'';
if($(this).parent().find('textarea').length==1) $(this).parents('.minimal-form-input').addClass('textarea');
}}
});
$(selector).each(function(){
if($(this).parents('.minimal-form-input').length==1&&$(this).find('.text').length==0){
$html=$(this).html();
$(this)[0].innerHTML=''+$html+'';
}});
}
convertToMinimalStyle('form label');
jQuery(document.body).on('updated_cart_totals', function(){
convertToMinimalStyle('form label');
});
setTimeout(function(){ convertToMinimalStyle('form label'); removeExcessLabels(); checkValueOnLoad(); },501);
function removeExcessLabels(){
$('.minimal-form-input').each(function(){
if($(this).find('label').length > 1){
$lngth=0;
$(this).find('label').each(function(){
if($(this).text().length >=$lngth){
$lngth=$(this).text().length;
$(this).parents('.minimal-form-input').find('label').addClass('tbr');
$(this).removeClass('tbr');
}});
$(this).find('label.tbr').remove();
}});
}
removeExcessLabels();
$('input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not(#search-outer input):not([type="hidden"]):not([type="button"]):not([type="date"]):not([type="color"]):not([type="number"]):not([type="range"]):not([role="button"]):not([role="combobox"]):not(.select2-focusser), textarea').each(function(){
if($(this).parents('.minimal-form-input').length==0){
$('').insertBefore($(this));
convertToMinimalStyle($(this).prev('label'));
}});
$('body').on('focus','.minimal-form-input input, .minimal-form-input textarea',function(){
$(this).parents('.minimal-form-input').addClass('filled').removeClass('no-text');
});
$('body').on('blur','.minimal-form-input input, .minimal-form-input textarea',function(){
if($(this).val().length > 0) $(this).parents('.minimal-form-input').addClass('has-text').removeClass('no-text');
else $(this).parents('.minimal-form-input').removeClass('has-text').addClass('no-text');
$(this).parents('.minimal-form-input').removeClass('filled');
});
function checkValueOnLoad(){
$('.minimal-form-input input, .minimal-form-input textarea').each(function(){
if($(this).val().length > 0) $(this).parents('.minimal-form-input').addClass('has-text').removeClass('no-text');
});
}
checkValueOnLoad();
var hiddenDiv=$('.hiddendiv').first();
if(!hiddenDiv.length){
hiddenDiv=$('');
$('body').append(hiddenDiv);
}
var text_area_selector='textarea';
function textareaAutoResize($textarea){
var fontFamily=$textarea.css('font-family');
var fontSize=$textarea.css('font-size');
if(fontSize){ hiddenDiv.css('font-size', fontSize); }
if(fontFamily){ hiddenDiv.css('font-family', fontFamily); }
if($textarea.attr('wrap')==="off"){
hiddenDiv.css('overflow-wrap', "normal")
.css('white-space', "pre");
}
hiddenDiv.text($textarea.val() + '\n');
var content=hiddenDiv.html().replace(/\n/g, '
');
hiddenDiv.html(content);
if($textarea.is(':visible')){
hiddenDiv.css('width', $textarea.width());
}else{
hiddenDiv.css('width', $(window).width()/2);
}
$textarea.css('height', hiddenDiv.height());
}
$(text_area_selector).each(function (){
var $textarea=$(this);
if($textarea.val().length){
textareaAutoResize($textarea);
}});
$('body').on('keyup keydown autoresize', text_area_selector, function (){
textareaAutoResize($(this));
});
}
if($('body[data-fancy-form-rcs="1"]').length > 0){
$('input[type="checkbox"]').each(function(){
$id=$(this).attr('id');
if(typeof $id!==typeof undefined&&$id!==false&&$('label[for="'+$id+'"]').length > 0){
$('label[for="'+$id+'"]').prepend('');
}});
$('.wpcf7-radio .wpcf7-list-item-label').each(function(i){
var $data=$(this).html();
var $name=$(this).parent().find('input').attr('name') + i;
$(this).parent().find('input').attr('id',$name);
$(this).replaceWith('');
});
$('.wpcf7-checkbox .wpcf7-list-item-label').each(function(){
var $data=$(this).html();
var $name=$(this).parent().find('input').attr('value');
$(this).parent().find('input').attr('id',$name);
$(this).replaceWith('');
});
$('select:not(.comment-form-rating #rating)').each(function(){
if($(this).parents('.wpcf7-form-control-wrap').length > 0){
if($(this).parents('.wpcf7-form-control-wrap').find('.select2-container').length > 0){
$selector=$($(this).prev('.select2-container'));
}else{
$selector=$(this);
}
if($selector.parents('.wpcf7-form-control-wrap').parent().find('label').length==1){
$selector.parents('.wpcf7-form-control-wrap').parent().wrapInner('');
}else{
$selector.wrap('');
}}else{
if($(this).prev('.select2-container').length > 0){
$selector=$(this).prev('.select2-container');
}else{
$selector=$(this);
}
if($selector.prev('label').length==1){
$selector.prev('label').andSelf().wrapAll('');
}else if($selector.next('label').length==1){
$selector.next('label').andSelf().wrapAll('');
}else{
$selector.wrap('');
}}
});
function select2Init(){
$('select:not(.state_select):not(.country_select):not(.comment-form-rating #rating)').each(function(){
$(this).select2({
minimumResultsForSearch: 7
});
});
}
select2Init();
}
$('a#toggle-section').click(function(){
if(!$('#style-selection').hasClass('open')){
var $distance=($('body[data-smooth-scrolling="0"]').length > 0) ? '0px':'13px';
$('#style-selection').addClass('open');
$('#style-selection').stop().animate({
'right':$distance
},600,'easeOutCubic');
}else{
var $distance=($('body[data-smooth-scrolling="0"]').length > 0) ? '-196px':'-177px';
$('#style-selection').removeClass('open');
$('#style-selection').stop().animate({
'right':$distance
},500,'easeInCubic');
if($('#style-selection .select2-choice').length > 0){
$('#style-selection .select2-container').removeClass('select2-container-active').removeClass('select2-dropdown-open');
$('.select2-drop, .select2-drop-mask').hide();
}}
return false;
});
if($('body[data-ajax-transitions="true"]').length > 0&&$('#ajax-loading-screen[data-method="ajax"]').length > 0&&!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)&&$(window).width() > 690){
$('#ajax-content-wrap').ajaxify({
'selector':'#ajax-content-wrap a:not(.no-ajaxy):not([target="_blank"]):not([href^="#"]):not(.comment-edit-link):not(#cancel-comment-reply-link):not(.comment-reply-link):not(#toggle-nav):not(.cart_list a):not(.logged-in-as a):not(.no-widget-added a):not(.add_to_cart_button):not(.product-wrap a):not(.section-down-arrow):not([data-filter]):not(.product_list_widget a):not(.pp):not([rel^="prettyPhoto"]):not(.pretty_photo), #header-outer li:not(.no-ajaxy) > a:not(.no-ajaxy), #header-outer #logo',
'verbosity': 0,
requestDelay: 400,
previewoff:true,
memoryoff: true,
turbo:false
});
$(window).on("pronto.render", initPage)
.on("pronto.load", destroyPage)
.on("pronto.request", transitionPage);
if($('.nectar-box-roll').length==0) setTimeout(function(){ waypoints(); },300);
initPage();
}else if($('body[data-ajax-transitions="true"]').length > 0&&$('#ajax-loading-screen[data-method="standard"]').length > 0){
$('html').addClass('page-trans-loaded');
if($('#ajax-loading-screen[data-effect="standard"]').length > 0){
if($('.nectar-particles').length==0) setTimeout(function(){ $('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ $(this).css({'display':'none'});});$('#ajax-loading-screen .loading-icon').transition({'opacity':0},800) },100);
if($('.nectar-box-roll').length==0) setTimeout(function(){ waypoints(); },750);
if(navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1||navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
window.onunload=function(){ $('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ $(this).css({'display':'none'});});$('#ajax-loading-screen .loading-icon').transition({'opacity':0},600) };
window.onpageshow=function(event){
if(event.persisted){
$('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){
$(this).css({'display':'none'});
});
$('#ajax-loading-screen .loading-icon').transition({'opacity':0},600);
}}
}else if(navigator.userAgent.indexOf('Firefox')!=-1){
window.onunload=function(){};}}else{
if($('#page-header-wrap #page-header-bg[data-animate-in-effect="zoom-out"] .nectar-video-wrap').length==0&&$('.parallax_slider_outer').length==0&&$('.first-nectar-slider').length==0){
setTimeout(function(){
$('#ajax-loading-screen').addClass('loaded');
setTimeout(function(){ $('#ajax-loading-screen').addClass('hidden'); },1000);
},150);
}
if(navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1||navigator.userAgent.match(/(iPod|iPhone|iPad)/)){
window.onunload=function(){ $('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ $(this).css({'display':'none'});});$('#ajax-loading-screen .loading-icon').transition({'opacity':0},600) };
window.onpageshow=function(event){
if(event.persisted){
$('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){
$(this).css({'display':'none'});
});
$('#ajax-loading-screen .loading-icon').transition({'opacity':0},600);
}}
}else if(navigator.userAgent.indexOf('Firefox')!=-1){
window.onunload=function(){};}
if($('.nectar-box-roll').length==0) setTimeout(function(){ waypoints(); },350);
}
$('.portfolio-loading, .nectar-slider-loading .loading-icon').remove();
if($('#ajax-loading-screen[data-disable-fade-on-click="1"]').length==0){
$('a[href]:not(.no-ajaxy):not([target="_blank"]):not([href^="#"]):not([href^="mailto:"]):not(.comment-edit-link):not(.magnific-popup):not(.magnific):not(.meta-comment-count a):not(.comments-link):not(#cancel-comment-reply-link):not(.comment-reply-link):not(#toggle-nav):not(.logged-in-as a):not(.add_to_cart_button):not(.section-down-arrow):not([data-filter]):not(.pp):not([rel^="prettyPhoto"]):not(.pretty_photo)').click(function(e){
var $windowCurrentLocation=window.location.href.split("#")[0];
var $windowClickedLocation=$(this).attr('href').split("#")[0];
if($(this).parent('.menu-item-has-children').length > 0&&$(this).parents('.off-canvas-menu-container').length > 0||($windowClickedLocation==$windowCurrentLocation)){
}else{
if(!$(this).parent().hasClass('no-ajaxy')){
var $targetLocation=$(this).attr('href');
var $timeOutDur=0;
if($targetLocation!=''){
$('#ajax-loading-screen').addClass('set-to-fade');
transitionPageStandard();
setTimeout(function(){
window.location=$targetLocation;
},$timeOutDur)
return false;
}}
}});
}}else{
if($('.nectar-box-roll').length==0) setTimeout(function(){ waypoints(); },100);
}
function transitionPage(e){
if($(window).scrollTop() > 0){
if($().niceScroll&&$("html").getNiceScroll()){
var nice=$("html").getNiceScroll();
nice.stop();
}
$('body,html').stop(true,true).animate({
scrollTop:0
},500,'easeOutQuad',function(){
$('#ajax-loading-screen').css({'opacity':'1', 'display':'none'});
$('#ajax-loading-screen').stop(true,true).fadeIn(600,function(){
$('#ajax-loading-screen .loading-icon').animate({'opacity':1},400);
setTimeout(function(){ if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click'); },400);
});
});
}else{
$('#ajax-loading-screen').css('opacity','1').stop().fadeIn(600,function(){
$('#ajax-loading-screen .loading-icon').animate({'opacity':1},400);
});
setTimeout(function(){ if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click'); },400);
}}
function transitionPageStandard(e){
$('#ajax-loading-screen').css('opacity','1').stop().fadeIn(500);
}
function destroyPage(e){
$(window).off('scroll.appear');
if($('#nectar_fullscreen_rows').length > 0&&$().fullpage)
$.fn.fullpage.destroy('all');
}
function initPage(e){
if(!$('body').hasClass('ajax-loaded')) return false;
lightBoxInit();
addOrRemoveSF();
$(".sf-menu").superfish('destroy');
$('#header-outer').removeClass('dark-slide');
initSF();
SFArrows();
headerInit();
var $effectTimeout=($('#ajax-loading-screen').length > 0) ? 800:0;
pageHeaderTextEffectInit();
if($('#page-header-bg .nectar-video-wrap video').length==0) setTimeout(pageHeaderTextEffect,$effectTimeout);
coloredButtons();
columnBGColors();
fwCarouselLinkFix();
if($('.carousel').length > 0){
standardCarouselInit();
clientsCarouselInit();
carouselHeightCalcs();
}
if($('.owl-carousel').length > 0) owlCarouselInit();
if($('.products-carousel').length > 0) productCarouselInit();
if($('#nectar_fullscreen_rows').length > 0&&$().fullpage){
setFPNames();
initFullPageFooter();
fullscreenRowLogic();
initNectarFP();
}
flexsliderInit();
progressBars();
dividers();
animated_titles();
milestoneInit();
accordionInit();
tabbedInit();
tabbbedDeepLinking();
accordionDeepLinking();
ulChecks();
oneFourthClasses();
carouselfGrabbingClass();
cascadingImageBGSizing();
clientsFadeIn();
fullWidthSections();
fwsClasses();
fullwidthImgOnlySizingInit();
fullwidthImgOnlySizing();
fullWidthRowPaddingAdjustInit();
fullWidthRowPaddingAdjustCalc();
boxRollInit();
setTimeout(function(){
colAndImgAnimations();
},100);
if($('body[data-animated-anchors="true"]').length > 0) setTimeout(scrollSpyInit,200);
nectar_fancy_ul_init();
socialSharingInit();
hotSpotHoverBind();
pricingTableHeight();
createTestimonialControls();
imageWithHotspotClickEvents();
testimonialSliderHeight();
largeIconHover();
fullscreenMenuInit();
boxRollMouseWheelInit();
midnightInit();
setTimeout(morphingOutlines,100);
responsiveVideoIframesInit();
responsiveVideoIframes();
fullWidthContentColumns();
videoBGInit();
$window.unbind('scroll.parallaxSections').unbind('resize.parallaxSections');
parallaxScrollInit();
masonryBlogInit();
masonryPortfolioInit();
portfolioAccentColor();
portfolioHoverEffects();
portfolioFiltersInit();
style6Img();
isotopeCatSelection();
$(window).unbind('.infscr');
infiniteScrollInit();
toTopBind();
centerLove();
postNextButtonEffect();
if($('.nectar-box-roll').length==0) headerRowColorInheritInit();
pageLoadHash();
slideOutWidgetAreaScrolling();
if($().wpcf7InitForm) $('div.wpcf7 > form').wpcf7InitForm();
wooPriceSlider();
if(typeof twttr!='undefined'){ twttr.widgets.load(); }
if(typeof init_rhc==='function'){ init_rhc(); }
$('.video-wrap iframe').unwrap();
$('#sidebar iframe[src]').unwrap();
$('video:not(.slider-video)').attr('width','100%');
$('video:not(.slider-video)').attr('height','100%');
$('.wp-video-shortcode.mejs-container').each(function(){
$(this).attr('data-aspectRatio', parseInt($(this).css('height')) / parseInt($(this).css('width')));
});
$('video.wp-media-shortcode-ajax, audio.wp-media-shortcode-ajax').each(function(){
if(!$(this).parent().hasClass('mejs-mediaelement')&&$().mediaelementplayer){
$(this).mediaelementplayer();
}});
$('.mejs-container').css({'height': '100%', 'width': '100%'});
$('audio').attr('width','100%');
$('audio').attr('height','100%');
$('audio').css('visibility','visible');
if($('body').hasClass('mobile')){
$('video').css('visibility','hidden');
}else{
$('video').css('visibility','visible');
}
$('.wpb_row:has(".nectar-video-wrap")').each(function(i){
$(this).css('z-index',100 + i);
});
showLateIframes();
mouseParallaxInit();
if(navigator.userAgent.indexOf('Chrome') > 0){
$('.swiper-wrapper .video-wrap').each(function(i){
var webmSource=jQuery(this).find('video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000);
var firstVideo=jQuery(this).find('video').get(0);
firstVideo.src=webmSource;
firstVideo.load();
});
}
if($('.nectar-video-bg').length > 0){
setTimeout(function(){
resizeVideoToCover();
$('.video-color-overlay').each(function(){
$(this).css('background-color',$(this).attr('data-color'));
});
$('.nectar-video-wrap').transition({'opacity':'1'},0);
$('.video-color-overlay').transition({'opacity':'0.7'},0);
},400);
}
nectarPageHeader();
$('#header-outer div.cart-outer').hoverIntent(function(){
$('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(400);
$('#header-outer .cart_list').stop(true,true).fadeIn(400);
clearTimeout(timeout);
$('#header-outer .cart-notification').fadeOut(300);
});
$('.portfolio-loading, .nectar-slider-loading .loading-icon').remove();
setTimeout(portfolioSidebarFollow,250);
setTimeout(portfolioSidebarFollow,500);
setTimeout(portfolioSidebarFollow,1000);
crossBrowserFixes();
$(window).trigger('resize');
$("#wpadminbar").show();
if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click');
setTimeout(function(){ $('#ajax-loading-screen').stop(true,true).fadeOut(500, function(){ $('#ajax-loading-screen .loading-icon').css({'opacity':0});});closeSearch(); },200);
setTimeout(function(){ $('#ajax-loading-screen').stop(true,true).fadeOut(500, function(){ $('#ajax-loading-screen .loading-icon').css({'opacity':0});});closeSearch(); },900);
}
(function($){
if(!$.fn.textareaCount){
$.fn.textareaCount=function(options, fn){
var defaults={
maxCharacterSize: -1,
originalStyle: 'originalTextareaInfo',
warningStyle: 'warningTextareaInfo',
warningNumber: 20,
displayFormat: '#input characters | #words words'
};
var options=$.extend(defaults, options);
var container=$(this);
$("
").insertAfter(container);
var charLeftCss={
'width':container.width()
};
var charLeftInfo=getNextCharLeftInformation(container);
charLeftInfo.addClass(options.originalStyle);
var numInput=0;
var maxCharacters=options.maxCharacterSize;
var numLeft=0;
var numWords=0;
container.bind('keyup', function(event){limitTextAreaByCharacterCount();})
.bind('mouseover', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);})
.bind('paste', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);});
limitTextAreaByCharacterCount();
function limitTextAreaByCharacterCount(){
charLeftInfo.html(countByCharacters());
if(typeof fn!='undefined'){
fn.call(this, getInfo());
}
return true;
}
function countByCharacters(){
var content=container.val();
var contentLength=content.length;
if(options.maxCharacterSize > 0){
if(contentLength >=options.maxCharacterSize){
content=content.substring(0, options.maxCharacterSize);
}
var newlineCount=getNewlineCount(content);
var systemmaxCharacterSize=options.maxCharacterSize - newlineCount;
if(!isWin()){
systemmaxCharacterSize=options.maxCharacterSize
}
if(contentLength > systemmaxCharacterSize){
var originalScrollTopPosition=this.scrollTop;
container.val(content.substring(0, systemmaxCharacterSize));
this.scrollTop=originalScrollTopPosition;
}
charLeftInfo.removeClass(options.warningStyle);
if(systemmaxCharacterSize - contentLength <=options.warningNumber){
charLeftInfo.addClass(options.warningStyle);
}
numInput=container.val().length + newlineCount;
if(!isWin()){
numInput=container.val().length;
}
numWords=countWord(getCleanedWordString(container.val()));
numLeft=maxCharacters - numInput;
}else{
var newlineCount=getNewlineCount(content);
numInput=container.val().length + newlineCount;
if(!isWin()){
numInput=container.val().length;
}
numWords=countWord(getCleanedWordString(container.val()));
}
return formatDisplayInfo();
}
function formatDisplayInfo(){
var format=options.displayFormat;
format=format.replace('#input', numInput);
format=format.replace('#words', numWords);
if(maxCharacters > 0){
format=format.replace('#max', maxCharacters);
format=format.replace('#left', numLeft);
}
return format;
}
function getInfo(){
var info={
input: numInput,
max: maxCharacters,
left: numLeft,
words: numWords
};
return info;
}
function getNextCharLeftInformation(container){
return container.next('.charleft');
}
function isWin(){
var strOS=navigator.appVersion;
if(strOS.toLowerCase().indexOf('win')!=-1){
return true;
}
return false;
}
function getNewlineCount(content){
var newlineCount=0;
for(var i=0; i1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document);
function vc_js(){
vc_toggleBehaviour(),
vc_tabsBehaviour(),
vc_accordionBehaviour(),
vc_teaserGrid(),
vc_carouselBehaviour(),
vc_slidersBehaviour(),
vc_prettyPhoto(),
vc_googleplus(),
vc_pinterest(),
vc_progress_bar(),
vc_plugin_flexslider(),
vc_google_fonts(),
vc_gridBehaviour(),
vc_rowBehaviour(),
vc_ttaActivation();
}
function getSizeName(){
var screen_w=jQuery(window).width();
return screen_w > 1170 ? "desktop_wide":screen_w > 960&&1169 > screen_w ? "desktop":screen_w > 768&&959 > screen_w ? "tablet":screen_w > 300&&767 > screen_w ? "mobile":300 > screen_w ? "mobile_portrait":""
}
function loadScript(url, $obj, callback){
var script=document.createElement("script");
script.type="text/javascript", script.readyState&&(script.onreadystatechange=function(){
("loaded"===script.readyState||"complete"===script.readyState)&&(script.onreadystatechange=null, callback())
}), script.src=url, $obj.get(0).appendChild(script)
}
function vc_ttaActivation(){
jQuery("[data-vc-accordion]").on("show.vc.accordion", function(e){
var $=window.jQuery,
ui={};
ui.newPanel=$(this).data("vc.accordion").getTarget(), window.wpb_prepare_tab_content(e, ui)
})
}
function vc_accordionActivate(event, ui){
if(ui.newPanel.length&&ui.newHeader.length){
var $pie_charts=ui.newPanel.find(".vc_pie_chart:not(.vc_ready)"),
$round_charts=ui.newPanel.find(".vc_round-chart"),
$line_charts=ui.newPanel.find(".vc_line-chart"),
$carousel=ui.newPanel.find('[data-ride="vc_carousel"]');
"undefined"!=typeof jQuery.fn.isotope&&ui.newPanel.find(".isotope, .wpb_image_grid_ul").isotope("layout"), ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){
var grid=jQuery(this).data("vcGrid");
grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()
}), vc_carouselBehaviour(ui.newPanel), vc_plugin_flexslider(ui.newPanel), $pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(), $round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({
reload: !1
}), $line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({
reload: !1
}), $carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"), ui.newPanel.parents(".isotope").length&&ui.newPanel.parents(".isotope").each(function(){
jQuery(this).isotope("layout")
})
}}
function initVideoBackgrounds(){
return window.console&&window.console.warn&&window.console.warn("this function is deprecated use vc_initVideoBackgrounds"), vc_initVideoBackgrounds()
}
function vc_initVideoBackgrounds(){
jQuery(".vc_row").each(function(){
var youtubeUrl, youtubeId, $row=jQuery(this);
$row.data("vcVideoBg") ? (youtubeUrl=$row.data("vcVideoBg"), youtubeId=vcExtractYoutubeId(youtubeUrl), youtubeId&&($row.find(".vc_video-bg").remove(), insertYoutubeVideoAsBackground($row, youtubeId)), jQuery(window).on("grid:items:added", function(event, $grid){
$row.has($grid).length&&vcResizeVideoBackground($row)
})):$row.find(".vc_video-bg").remove()
})
}
function insertYoutubeVideoAsBackground($element, youtubeId, counter){
if("undefined"==typeof YT.Player) return counter="undefined"==typeof counter ? 0:counter, counter > 100 ? void console.warn("Too many attempts to load YouTube api"):void setTimeout(function(){
insertYoutubeVideoAsBackground($element, youtubeId, counter++)
}, 100);
var $container=$element.prepend('').find(".inner");
new YT.Player($container[0], {
width: "100%",
height: "100%",
videoId: youtubeId,
playerVars: {
playlist: youtubeId,
iv_load_policy: 3,
enablejsapi: 1,
disablekb: 1,
autoplay: 1,
controls: 0,
showinfo: 0,
rel: 0,
loop: 1
},
events: {
onReady: function(event){
event.target.mute().setLoop(!0)
}}
}), vcResizeVideoBackground($element), jQuery(window).bind("resize", function(){
vcResizeVideoBackground($element)
})
}
function vcResizeVideoBackground($element){
var iframeW, iframeH, marginLeft, marginTop, containerW=$element.innerWidth(),
containerH=$element.innerHeight(),
ratio1=16,
ratio2=9;
ratio1 / ratio2 > containerW / containerH ? (iframeW=containerH * (ratio1 / ratio2), iframeH=containerH, marginLeft=-Math.round((iframeW - containerW) / 2) + "px", marginTop=-Math.round((iframeH - containerH) / 2) + "px", iframeW +="px", iframeH +="px"):(iframeW=containerW, iframeH=containerW * (ratio2 / ratio1), marginTop=-Math.round((iframeH - containerH) / 2) + "px", marginLeft=-Math.round((iframeW - containerW) / 2) + "px", iframeW +="px", iframeH +="px"), $element.find(".vc_video-bg iframe").css({
maxWidth: "1000%",
marginLeft: marginLeft,
marginTop: marginTop,
width: iframeW,
height: iframeH
})
}
function vcExtractYoutubeId(url){
if("undefined"==typeof url) return !1;
var id=url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);
return null!==id ? id[1]:!1
}
document.documentElement.className +=" js_active ", document.documentElement.className +="ontouchstart" in document.documentElement ? " vc_mobile ":" vc_desktop ",
function(){
for (var prefix=["-webkit-", "-moz-", "-ms-", "-o-", ""], i=0; i < prefix.length; i++) prefix[i] + "transform" in document.documentElement.style&&(document.documentElement.className +=" vc_transform ")
}(), "function"!=typeof window.vc_plugin_flexslider&&(window.vc_plugin_flexslider=function($parent){
var $slider=$parent ? $parent.find(".wpb_flexslider"):jQuery(".wpb_flexslider");
$slider.each(function(){
var this_element=jQuery(this),
sliderSpeed=800,
sliderTimeout=1e3 * parseInt(this_element.attr("data-interval")),
sliderFx=this_element.attr("data-flex_fx"),
slideshow = !0;
0===sliderTimeout&&(slideshow = !1), this_element.is(":visible")&&this_element.flexslider({
animation: sliderFx,
slideshow: slideshow,
slideshowSpeed: sliderTimeout,
sliderSpeed: sliderSpeed,
smoothHeight: !0
})
})
}), "function"!=typeof window.vc_googleplus&&(window.vc_googleplus=function(){
0 < jQuery(".wpb_googleplus").length&&! function(){
var po=document.createElement("script");
po.type="text/javascript", po.async = !0, po.src="//apis.google.com/js/plusone.js";
var s=document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(po, s)
}()
}), "function"!=typeof window.vc_pinterest&&(window.vc_pinterest=function(){
0 < jQuery(".wpb_pinterest").length&&! function(){
var po=document.createElement("script");
po.type="text/javascript", po.async = !0, po.src="//assets.pinterest.com/js/pinit.js";
var s=document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(po, s)
}()
}), "function"!=typeof window.vc_progress_bar&&(window.vc_progress_bar=function(){
"undefined"!=typeof jQuery.fn.waypoint&&jQuery(".vc_progress_bar").waypoint(function(){
jQuery(this).find(".vc_single_bar").each(function(index){
var $this=jQuery(this),
bar=$this.find(".vc_bar"),
val=bar.data("percentage-value");
setTimeout(function(){
bar.css({
width: val + "%"
})
}, 200 * index)
})
}, {
offset: "85%"
})
}), "function"!=typeof window.vc_waypoints&&(window.vc_waypoints=function(){
"undefined"!=typeof jQuery.fn.waypoint&&jQuery(".wpb_animate_when_almost_visible:not(.wpb_start_animation)").waypoint(function(){
jQuery(this).addClass("wpb_start_animation")
}, {
offset: "85%"
})
}), "function"!=typeof window.vc_toggleBehaviour&&(window.vc_toggleBehaviour=function($el){
function event(e){
e&&e.preventDefault&&e.preventDefault();
var title=jQuery(this),
element=title.closest(".vc_toggle"),
content=element.find(".vc_toggle_content");
element.hasClass("vc_toggle_active") ? content.slideUp({
duration: 300,
complete: function(){
element.removeClass("vc_toggle_active")
}}):content.slideDown({
duration: 300,
complete: function(){
element.addClass("vc_toggle_active")
}})
}
$el ? $el.hasClass("vc_toggle_title") ? $el.unbind("click").click(event):$el.find(".vc_toggle_title").unbind("click").click(event):jQuery(".vc_toggle_title").unbind("click").on("click", event)
}), "function"!=typeof window.vc_tabsBehaviour&&(window.vc_tabsBehaviour=function($tab){
if(jQuery.ui){
var $call=$tab||jQuery(".wpb_tabs, .wpb_tour"),
ver=jQuery.ui&&jQuery.ui.version ? jQuery.ui.version.split("."):"1.10",
old_version=1===parseInt(ver[0])&&9 > parseInt(ver[1]);
$call.each(function(index){
var $tabs, interval=jQuery(this).attr("data-interval"),
tabs_array=[];
if($tabs=jQuery(this).find(".wpb_tour_tabs_wrapper").tabs({
show: function(event, ui){
wpb_prepare_tab_content(event, ui)
},
beforeActivate: function(event, ui){
1!==ui.newPanel.index()&&ui.newPanel.find(".vc_pie_chart:not(.vc_ready)")
},
activate: function(event, ui){
wpb_prepare_tab_content(event, ui)
}}), interval&&interval > 0) try {
$tabs.tabs("rotate", 1e3 * interval)
} catch (e){
window.console&&window.console.log&&console.log(e)
}
jQuery(this).find(".wpb_tab").each(function(){
tabs_array.push(this.id)
}), jQuery(this).find(".wpb_tabs_nav li").click(function(e){
return e.preventDefault(), old_version ? $tabs.tabs("select", jQuery("a", this).attr("href")):$tabs.tabs("option", "active", jQuery(this).index()), !1
}), jQuery(this).find(".wpb_prev_slide a, .wpb_next_slide a").click(function(e){
if(e.preventDefault(), old_version){
var index=$tabs.tabs("option", "selected");
jQuery(this).parent().hasClass("wpb_next_slide") ? index++:index--, 0 > index ? index=$tabs.tabs("length") - 1:index >=$tabs.tabs("length")&&(index=0), $tabs.tabs("select", index)
}else{
var index=$tabs.tabs("option", "active"),
length=$tabs.find(".wpb_tab").length;
index=jQuery(this).parent().hasClass("wpb_next_slide") ? index + 1 >=length ? 0:index + 1:0 > index - 1 ? length - 1:index - 1, $tabs.tabs("option", "active", index)
}})
})
}}), "function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){
jQuery(".wpb_accordion").each(function(index){
var $tabs, $this=jQuery(this),
active_tab=($this.attr("data-interval"), !isNaN(jQuery(this).data("active-tab"))&&0 < parseInt($this.data("active-tab")) ? parseInt($this.data("active-tab")) - 1:!1),
collapsible = !1===active_tab||"yes"===$this.data("collapsible");
$tabs=$this.find(".wpb_accordion_wrapper").accordion({
header: "> div > h3",
autoHeight: !1,
heightStyle: "content",
active: active_tab,
collapsible: collapsible,
navigation: !0,
activate: vc_accordionActivate,
change: function(event, ui){
"undefined"!=typeof jQuery.fn.isotope&&ui.newContent.find(".isotope").isotope("layout"), vc_carouselBehaviour(ui.newPanel)
}}), !0===$this.data("vcDisableKeydown")&&($tabs.data("uiAccordion")._keydown=function(){})
})
}), "function"!=typeof window.vc_teaserGrid&&(window.vc_teaserGrid=function(){
var layout_modes={
fitrows: "fitRows",
masonry: "masonry"
};
jQuery(".wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)").each(function(){
var $container=jQuery(this),
$thumbs=$container.find(".wpb_thumbnails"),
layout_mode=$thumbs.attr("data-layout-mode");
$thumbs.isotope({
itemSelector: ".isotope-item",
layoutMode: "undefined"==typeof layout_modes[layout_mode] ? "fitRows":layout_modes[layout_mode]
}), $container.find(".categories_filter a").data("isotope", $thumbs).click(function(e){
e.preventDefault();
var $thumbs=jQuery(this).data("isotope");
jQuery(this).parent().parent().find(".active").removeClass("active"), jQuery(this).parent().addClass("active"), $thumbs.isotope({
filter: jQuery(this).attr("data-filter")
})
}), jQuery(window).bind("load resize", function(){
$thumbs.isotope("layout")
})
})
}), "function"!=typeof window.vc_carouselBehaviour&&(window.vc_carouselBehaviour=function($parent){
var $carousel=$parent ? $parent.find(".wpb_carousel"):jQuery(".wpb_carousel");
$carousel.each(function(){
var $this=jQuery(this);
if(!0!==$this.data("carousel_enabled")&&$this.is(":visible")){
$this.data("carousel_enabled", !0);
var carousel_speed=(getColumnsCount(jQuery(this)), 500);
jQuery(this).hasClass("columns_count_1")&&(carousel_speed=900);
var carousele_li=jQuery(this).find(".wpb_thumbnails-fluid li");
carousele_li.css({
"margin-right": carousele_li.css("margin-left"),
"margin-left": 0
});
var fluid_ul=jQuery(this).find("ul.wpb_thumbnails-fluid");
fluid_ul.width(fluid_ul.width() + 300), jQuery(window).resize(function(){
var before_resize=screen_size;
screen_size=getSizeName(), before_resize!=screen_size&&window.setTimeout("location.reload()", 20)
})
}})
}), "function"!=typeof window.vc_slidersBehaviour&&(window.vc_slidersBehaviour=function(){
jQuery(".wpb_gallery_slides").each(function(index){
var $imagesGrid, this_element=jQuery(this);
if(this_element.hasClass("wpb_slider_nivo")){
var sliderSpeed=800,
sliderTimeout=1e3 * this_element.attr("data-interval");
0===sliderTimeout&&(sliderTimeout=9999999999), this_element.find(".nivoSlider").nivoSlider({
effect: "boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse",
slices: 15,
boxCols: 8,
boxRows: 4,
animSpeed: sliderSpeed,
pauseTime: sliderTimeout,
startSlide: 0,
directionNav: !0,
directionNavHide: !0,
controlNav: !0,
keyboardNav: !1,
pauseOnHover: !0,
manualAdvance: !1,
prevText: "Prev",
nextText: "Next"
})
} else this_element.hasClass("wpb_image_grid")&&(jQuery.fn.imagesLoaded ? $imagesGrid=this_element.find(".wpb_image_grid_ul").imagesLoaded(function(){
$imagesGrid.isotope({
itemSelector: ".isotope-item",
layoutMode: "fitRows"
})
}):this_element.find(".wpb_image_grid_ul").isotope({
itemSelector: ".isotope-item",
layoutMode: "fitRows"
}))
})
}), "function"!=typeof window.vc_prettyPhoto&&(window.vc_prettyPhoto=function(){
try {
jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto&&jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({
animationSpeed: "normal",
padding: 15,
opacity: .7,
showTitle: !0,
allowresize: !0,
counter_separator_label: "/",
hideflash: !1,
deeplinking: !1,
modal: !1,
callback: function(){
var url=location.href,
hashtag=url.indexOf("#!prettyPhoto") ? !0:!1;
hashtag&&(location.hash="!")
},
social_tools: ""
})
} catch (err){
window.console&&window.console.log&&console.log(err)
}}), "function"!=typeof window.vc_google_fonts&&(window.vc_google_fonts=function(){
return !1
}), window.vcParallaxSkroll = !1, "function"!=typeof window.vc_rowBehaviour&&(window.vc_rowBehaviour=function(){
function fullWidthRow(){
var $elements=$('[data-vc-full-width="true"]');
$.each($elements, function(key, item){
var $el=$(this);
$el.addClass("vc_hidden");
var $el_full=$el.next(".vc_row-full-width");
$el_full.length||($el_full=$el.parent().next(".vc_row-full-width"));
var el_margin_left=parseInt($el.css("margin-left"), 10),
el_margin_right=parseInt($el.css("margin-right"), 10),
offset=0 - $el_full.offset().left - el_margin_left,
width=$(window).width();
if($el.css({
position: "relative",
left: offset,
"box-sizing": "border-box",
width: $(window).width()
}), !$el.data("vcStretchContent")){
var padding=-1 * offset;
0 > padding&&(padding=0);
var paddingRight=width - padding - $el_full.width() + el_margin_left + el_margin_right;
0 > paddingRight&&(paddingRight=0), $el.css({
"padding-left": padding + "px",
"padding-right": paddingRight + "px"
})
}
$el.attr("data-vc-full-width-init", "true"), $el.removeClass("vc_hidden")
})
}
function parallaxRow(){
var vcSkrollrOptions, callSkrollInit = !1;
return window.vcParallaxSkroll&&window.vcParallaxSkroll.destroy(), $(".vc_parallax-inner").remove(), $("[data-5p-top-bottom]").removeAttr("data-5p-top-bottom data-30p-top-bottom"), $("[data-vc-parallax]").each(function(){
var skrollrSpeed, skrollrSize, skrollrStart, skrollrEnd, $parallaxElement, parallaxImage, youtubeId;
callSkrollInit = !0, "on"===$(this).data("vcParallaxOFade")&&$(this).children().attr("data-5p-top-bottom", "opacity:0;").attr("data-30p-top-bottom", "opacity:1;"), skrollrSize=100 * $(this).data("vcParallax"), $parallaxElement=$("").addClass("vc_parallax-inner").appendTo($(this)), $parallaxElement.height(skrollrSize + "%"), parallaxImage=$(this).data("vcParallaxImage"), youtubeId=vcExtractYoutubeId(parallaxImage), youtubeId ? insertYoutubeVideoAsBackground($parallaxElement, youtubeId):"undefined"!=typeof parallaxImage&&$parallaxElement.css("background-image", "url(" + parallaxImage + ")"), skrollrSpeed=skrollrSize - 100, skrollrStart=-skrollrSpeed, skrollrEnd=0, $parallaxElement.attr("data-bottom-top", "top: " + skrollrStart + "%;").attr("data-top-bottom", "top: " + skrollrEnd + "%;")
}), callSkrollInit&&window.skrollr ? (vcSkrollrOptions={
forceHeight: !1,
smoothScrolling: !1,
mobileCheck: function(){
return !1
}}, window.vcParallaxSkroll=skrollr.init(vcSkrollrOptions), window.vcParallaxSkroll):!1
}
function fullHeightRow(){
$(".vc_row-o-full-height:first").each(function(){
var $window, windowHeight, offsetTop, fullHeight;
$window=$(window), windowHeight=$window.height(), offsetTop=$(this).offset().top, windowHeight > offsetTop&&(fullHeight=100 - offsetTop / (windowHeight / 100), $(this).css("min-height", fullHeight + "vh"))
})
}
function fixIeFlexbox(){
var ua=window.navigator.userAgent,
msie=ua.indexOf("MSIE ");
(msie > 0||navigator.userAgent.match(/Trident.*rv\:11\./))&&$(".vc_row-o-full-height").each(function(){
"flex"===$(this).css("display")&&$(this).wrap('')
})
}
var $=window.jQuery;
$(window).off("resize.vcRowBehaviour").on("resize.vcRowBehaviour", fullWidthRow).on("resize.vcRowBehaviour", fullHeightRow), fullWidthRow(), fullHeightRow(), fixIeFlexbox(), vc_initVideoBackgrounds(), parallaxRow()
}), "function"!=typeof window.vc_gridBehaviour&&(window.vc_gridBehaviour=function(){
jQuery.fn.vcGrid&&jQuery("[data-vc-grid]").vcGrid()
}), "function"!=typeof window.getColumnsCount&&(window.getColumnsCount=function(el){
for (var find = !1, i=1; !1===find;){
if(el.hasClass("columns_count_" + i)) return find = !0, i;
i++
}});
var screen_size=getSizeName();
"function"!=typeof window.wpb_prepare_tab_content&&(window.wpb_prepare_tab_content=function(event, ui){
var $ui_panel, $google_maps, panel=ui.panel||ui.newPanel,
$pie_charts=panel.find(".vc_pie_chart:not(.vc_ready)"),
$round_charts=panel.find(".vc_round-chart"),
$line_charts=panel.find(".vc_line-chart"),
$carousel=panel.find('[data-ride="vc_carousel"]');
if(vc_carouselBehaviour(), vc_plugin_flexslider(panel), ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){
var grid=jQuery(this).data("vcGrid");
grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()
}), panel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&panel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){
var grid=jQuery(this).data("vcGrid");
grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()
}), $pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(), $round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({
reload: !1
}), $line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({
reload: !1
}), $carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"), $ui_panel=panel.find(".isotope, .wpb_image_grid_ul"), $google_maps=panel.find(".wpb_gmaps_widget"), 0 < $ui_panel.length&&$ui_panel.isotope("layout"), $google_maps.length&&!$google_maps.is(".map_ready")){
var $frame=$google_maps.find("iframe");
$frame.attr("src", $frame.attr("src")), $google_maps.addClass("map_ready")
}
panel.parents(".isotope").length&&panel.parents(".isotope").each(function(){
jQuery(this).isotope("layout")
})
}), jQuery(document).ready(function($){
window.vc_js()
});